All Projects → peptos → Traffic Shm

peptos / Traffic Shm

Licence: apache-2.0
traffic-shm (Anna) is a Java based lock free IPC library.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Traffic Shm

Sharedhashfile
Share Hash Tables With Stable Key Hints Stored In Memory Mapped Files Between Arbitrary Processes
Stars: ✭ 380 (+427.78%)
Mutual labels:  shared-memory, ipc
Heim
Cross-platform async library for system information fetching 🦀
Stars: ✭ 572 (+694.44%)
Mutual labels:  async, cross-platform
Libcopp
cross-platform coroutine library in c++
Stars: ✭ 398 (+452.78%)
Mutual labels:  lock-free, cross-platform
Mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
Stars: ✭ 321 (+345.83%)
Mutual labels:  lock-free, queue
Yac
A fast, lock-free, shared memory user data cache for PHP
Stars: ✭ 782 (+986.11%)
Mutual labels:  lock-free, shared-memory
Ipc
IPC is a C++ library that provides inter-process communication using shared memory on Windows. A .NET wrapper is available which allows interaction with C++ as well.
Stars: ✭ 332 (+361.11%)
Mutual labels:  shared-memory, ipc
Fern.vim
🌿 General purpose asynchronous tree viewer written in Pure Vim script
Stars: ✭ 552 (+666.67%)
Mutual labels:  async, cross-platform
IPC.Bond
IPC.Bond is an extension of IPC library that provides inter-process communication using shared memory on Windows with Bond serialization.
Stars: ✭ 26 (-63.89%)
Mutual labels:  ipc, shared-memory
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (+865.28%)
Mutual labels:  async, queue
Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (+858.33%)
Mutual labels:  async, lock-free
Spscqueue
A bounded single-producer single-consumer wait-free and lock-free queue written in C++11
Stars: ✭ 307 (+326.39%)
Mutual labels:  lock-free, queue
Storage Based Queue
Javascript queue library with persistent storage based queue mechanism for the browsers environments. Specially designed for offline.
Stars: ✭ 33 (-54.17%)
Mutual labels:  async, queue
Ecal
eCAL - enhanced Communication Abstraction Layer
Stars: ✭ 292 (+305.56%)
Mutual labels:  shared-memory, ipc
Atomic queue
C++ lockless queue.
Stars: ✭ 373 (+418.06%)
Mutual labels:  lock-free, queue
lfqueue
Minimize lock-free queue ever!
Stars: ✭ 107 (+48.61%)
Mutual labels:  queue, lock-free
Cpp Ipc
C++ IPC Library: A high-performance inter-process communication using shared memory on Linux/Windows.
Stars: ✭ 420 (+483.33%)
Mutual labels:  shared-memory, ipc
node-svmq
Native System V message queues in Node.js
Stars: ✭ 16 (-77.78%)
Mutual labels:  queue, ipc
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (-23.61%)
Mutual labels:  queue, lock-free
Usockets
Miniscule cross-platform eventing, networking & crypto for async applications
Stars: ✭ 611 (+748.61%)
Mutual labels:  async, cross-platform
Fennel
A task queue library for Python and Redis
Stars: ✭ 24 (-66.67%)
Mutual labels:  async, queue

traffic-shm logo

Overview

traffic-shm (Shared Memory) is a Java based message library, which is designed for interprocess communication (IPC) on the same server.

Features

1. Pure Java

Shared memory is an efficient mechanism for interprocess communication. Memory mapped files offer a dynamical memory management feature that allows applications to access files on disk in the same way they attach the shared segment of physical memory to their virtual address spaces.

traffic-shm provides a pure java implementation using sun.misc.Unsafe and FileChannel, JDK 1.6+ is required.

2. Cross-Platform

alignment: 4-bytes aligned byteorder: big-endian

Most of the major operating systems like Linux, macOS, Windows, AIX and HP-UX are supported.

Note:

  • set -Xmpas:on on HP-UX
  • set --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED option to support JDK 9+

3. Async Mode:

3.1 Lock-Free

With non-blocking algorithm, implementation of multi-producer/single-consumer and multi-producer/multi-consumer concurrent queue, traffic-shm could be use to build a real-time system with high throughput and low latency.

3.2 Message Ordering

traffic-shm provides a FIFO queue which is ONCE-AND-ONLY-ONCE guaranteed. cursor is forward only, once a message is delivered successfully, message is AUTOMATIC ACKNOWLEDGEMENT which means that a message is acknowledged as soon as the receiver gets it.

4. Sync Mode:

4.1 Segmental Lock

offer a multi-producer/single-consumer concurrent data structure

Data Structure Layout

Async Mode: Async

Getting Started

Async:

Reader:

Queue queue = Queue.map("/Users/peptos/ashm", 2000L);;

while (running) {
	Block block = queue.poll();
	if (block != null) {
		System.out.println(new String(block.getPayload(), "UTF-8"));
	} else {
		Util.pause(10);
	}
}

queue.close();

Writer:

Queue queue = Queue.attach("/Users/peptos/ashm");

String string = "hello, world";
byte[] bytes = string.getBytes("UTF-8");
System.out.println(queue.offer(new Block(bytes)));

queue.close();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].