Concurrent Queue Library

High-performance, lock-free queue implementation for modern multi-threaded applications

Key Features

  • Lock-free MPMC (Multiple Producer Multiple Consumer) queue
  • Wait-free SPSC (Single Producer Single Consumer) variant
  • Bounded and unbounded queue options
  • C++17 and Java implementations
  • Comprehensive benchmarks and test suite
  • Header-only C++ library for easy integration

Overview

The Concurrent Queue Library provides production-ready, high-performance queue implementations that scale efficiently across multiple cores. Our lock-free algorithms ensure maximum throughput and minimal latency in multi-threaded environments.

Key Features

Lock-Free Performance

Our MPMC queue uses advanced lock-free algorithms to achieve:

  • 10x throughput compared to standard mutex-based queues
  • Predictable latency with no thread blocking
  • Linear scalability up to 128 cores

Memory Efficiency

  • Optimized memory layout to minimize cache misses
  • Configurable memory ordering for different use cases
  • Optional memory pooling for zero-allocation operation

Easy Integration

#include <lockfree/queue.hpp>

// Create a bounded queue
lockfree::Queue<Task> taskQueue(1024);

// Producer thread
taskQueue.enqueue(Task{...});

// Consumer thread
Task task;
if (taskQueue.dequeue(task)) {
    process(task);
}

Use Cases

  • Task Scheduling: Distribute work across thread pools
  • Event Processing: High-throughput event handling systems
  • Message Passing: Inter-thread communication
  • Pipeline Processing: Connect stages in processing pipelines

Performance Benchmarks

Our benchmarks show significant performance improvements over traditional implementations:

| Threads | Mutex Queue | Lock-Free Queue | Improvement | |---------|-------------|-----------------|-------------| | 4 | 2.1M ops/s | 18.5M ops/s | 8.8x | | 8 | 1.8M ops/s | 35.2M ops/s | 19.5x | | 16 | 1.2M ops/s | 68.9M ops/s | 57.4x |

Getting Started

  1. Download the library from our repository
  2. Include the header files in your project
  3. Link against atomic operations library if required
  4. Start using lock-free queues immediately

Support

  • Comprehensive documentation with examples
  • Active community forum
  • Priority support for enterprise customers
  • Regular updates and performance improvements