All Projects → MengRao → SPSC_Queue

MengRao / SPSC_Queue

Licence: MIT license
A highly optimized single producer single consumer message queue C++ template

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SPSC Queue

MPSC Queue
A multi-producer single consumer queue C++ template suitable for async logging with SHM IPC support
Stars: ✭ 51 (-72.43%)
Mutual labels:  message-queue, low-latency, shared-memory
Jocket
Low-latency java socket implementation (using shared memory)
Stars: ✭ 83 (-55.14%)
Mutual labels:  low-latency, shared-memory
reactor-aeron
A reactive driver for Aeron transport (https://github.com/real-logic/aeron)
Stars: ✭ 43 (-76.76%)
Mutual labels:  low-latency, shared-memory
Tcpshm
A connection-oriented persistent message queue framework based on TCP or SHM(shared memory)
Stars: ✭ 314 (+69.73%)
Mutual labels:  message-queue, shared-memory
Nats.c
A C client for NATS
Stars: ✭ 220 (+18.92%)
Mutual labels:  message-queue
Message Bus
Go simple async message bus
Stars: ✭ 166 (-10.27%)
Mutual labels:  message-queue
Autocser
AutoCSer is a high-performance RPC framework. AutoCSer 是一个以高效率为目标向导的整体开发框架。主要包括 TCP 接口服务框架、TCP 函数服务框架、远程表达式链组件、前后端一体 WEB 视图框架、ORM 内存索引缓存框架、日志流内存数据库缓存组件、消息队列组件、二进制 / JSON / XML 数据序列化 等一系列无缝集成的高性能组件。
Stars: ✭ 140 (-24.32%)
Mutual labels:  message-queue
Rxmq.js
JavaScript pub/sub library based on RxJS
Stars: ✭ 134 (-27.57%)
Mutual labels:  message-queue
mini-async-log-c
Mini async log C port. Now with C++ wrappers.
Stars: ✭ 69 (-62.7%)
Mutual labels:  low-latency
Kmq
Kafka-based message queue
Stars: ✭ 239 (+29.19%)
Mutual labels:  message-queue
Vernemq
A distributed MQTT message broker based on Erlang/OTP. Built for high quality & Industrial use cases.
Stars: ✭ 2,628 (+1320.54%)
Mutual labels:  message-queue
Liftbridge
Lightweight, fault-tolerant message streams.
Stars: ✭ 2,175 (+1075.68%)
Mutual labels:  message-queue
Akka Rabbitmq
RabbitMq client in Scala and Akka actors
Stars: ✭ 228 (+23.24%)
Mutual labels:  message-queue
Enqueue Dev
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
Stars: ✭ 1,977 (+968.65%)
Mutual labels:  message-queue
Advanced Java
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
Stars: ✭ 59,142 (+31868.65%)
Mutual labels:  message-queue
Gores
👷 Redis-backed library for creating background jobs in Go. Placing jobs in multiple queues, and process them later asynchronously.
Stars: ✭ 137 (-25.95%)
Mutual labels:  message-queue
Phpnats
A PHP client for the NATSio cloud messaging system.
Stars: ✭ 209 (+12.97%)
Mutual labels:  message-queue
Enqueue Bundle
[READ-ONLY] Message queue bundle for Symfony. RabbitMQ, Amazon SQS, Redis, Service bus, Async events, RPC over MQ and a lot more
Stars: ✭ 233 (+25.95%)
Mutual labels:  message-queue
Qmq
QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Stars: ✭ 2,420 (+1208.11%)
Mutual labels:  message-queue
Hangfire.topshelf
Best practice for hangfire samples
Stars: ✭ 192 (+3.78%)
Mutual labels:  message-queue

SPSC_Queue

A single producer single consumer lock-free queue C++ template for ultimate low latency, which can be used in multithread conmunication as well as in shared memory IPC under Linux.

The latency of communication of a 10-200B message is within 50-100 ns between two cpu cores on the same node. Sender and receiver don't need to copy a single byte of the msg, that is, a msg is allocated in the queue memory and set by sender, then read directly by the receiver in another thread/process.

This Library mainly contains 4 C++ templates, 2 for single typed queue and 2 for variant typed queue:

SPSCQueue.h

An atomic(crash safe when used in shared-memory IPC) single typed queue template.

SPSCQueueOPT.h

An optimized implementation of SPSCQueue, in which each msg has an additional bool header and write_idx and read_idx are not shared between threads. Note that Push() and Pop() operation are not atomic so it should not be used in IPC.

SPSCVarQueue.h

An atomic(crash safe when used in shared-memory IPC) general purpose variant typed queue template, with a header before each msg. This queue is used in TCPSHM: a connection-oriented persistent message queue framework based on TCP or SHM .

SPSCVarQueueOPT.h

An optimized implementation of SPSCVarQueue, in which reader doens't need to read write_idx so latency is reduced when new msg comes. Note that SPSCVarQueueOPT is not atomic.

Test

shmq_recv.cc/shmq_send.cc

A shared memory IPC example for testing SPSCQueue/SPSCQueueOPT.

multhread_q.cc

A multi-thread example for testing SPSCQueue/SPSCQueueOPT.

multhread_varq.cc

A multi-thread example for testing SPSCVarQueue/SPSCVarQueueOPT

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].