qmetrics.net

Readerwriterqueue

Single-producer single-consumer lock-free C++ queue

A header-only style C++ queue for one producer and one consumer thread without locks. Includes a optional blocking circular-buffer variant.

Overview

This package provides a lock-free queue for C++ aimed at single-producer, single-consumer workloads. One thread enqueues and another dequeues; roles do not switch, though a single thread could use both sides. The author notes a separate multi-producer, multi-consumer queue for broader parallelism.

The main queue is templated for any element type, pre-allocates contiguous blocks, and supports C++11 move semantics. try_enqueue never allocates after the initial capacity; enqueue can grow the queue. try_emplace and emplace shortcuts are included. Operations are wait-free with O(1) enqueue and dequeue aside from growth allocation, and on x86 memory barriers may compile to no-ops.

A circular-buffer variant adds blocking wait_dequeue and timed wait with configurable spin counts before OS blocking. Integration is by including readerwriterqueue.h, readerwritercircularbuffer.h, and atomicops.h; CMake targets can vend the headers system-wide.

Documentation warns the queue suits platforms where aligned integer and pointer access is atomic, with primary testing on x86 and x86-64. GCC 4.7 or newer is required for correct atomic fence behavior.

Key features

  • Lock-free SPSC queue
  • Blocking circular buffer variant
  • try_enqueue without allocation
  • C++11 move-friendly templates
  • wait_dequeue blocking API
  • CMake install and target support
  • Pre-allocated contiguous storage

Use cases

  • Audio or sensor producer-consumer pipelines
  • Game engine job handoff between threads
  • Logging or metrics off hot paths
  • Embedded-style two-thread message passing

Similar software

Socket.IO

Bidirectional real-time communication for web and Node

Socket.IO enables low-latency, event-based communication between clients and servers. It prefers WebSockets and falls back to HTTP long-polling when needed.

★ 63.3k⟳ 4 days agoMIT
Frameworks & PlatformsDesktop/CLI app

ntfy

HTTP pub-sub push notification service

Ntfy sends push notifications to phones and desktops via simple HTTP PUT or POST requests and a REST API, without requiring sign-up on the public host.

★ 35.8k⟳ todayApache-2.0

Celery

Distributed task queue for Python workers and brokers

Celery distributes units of work called tasks from client applications to worker processes through a message broker. It supports RabbitMQ, Redis, Amazon SQS, and other transports with retries and scheduling features.

★ 29.3k⟳ yesterdayBSD-3-Clause

NSQ

Realtime distributed message queue and pub-sub platform

NSQ is a distributed messaging system built for large-scale throughput. It avoids single points of failure and ships with official Go and Python client libraries.

★ 25.8k⟳ 3 months agoMIT

Redisson

Java client and real-time data platform for Valkey and Redis

Redisson is a Java client for Valkey and Redis with synchronous, asynchronous, reactive, and RxJava APIs. It adds distributed collections, locks, queues, caching helpers, and related services on top of standard Valkey or Redis deployments.

★ 24.4k⟳ 4 days agoApache-2.0

whatsapp-web.js

Node.js client for WhatsApp Web automation

whatsapp-web.js drives WhatsApp Web through Puppeteer so Node programs can send, receive, and manage chats with many web-client features. It targets multi-device accounts and documents session auth strategies.

★ 23k⟳ 3 days agoApache-2.0
Integration PlatformsDesktop/CLI app