A fast, industrial-strength, lock-free concurrent queue for C++11 supporting multi-producer and multi-consumer patterns.
moodycamel::ConcurrentQueue is a lock-free concurrent queue implementation for C++11, designed for high-performance multi-threaded applications. It allows multiple producers and consumers to enqueue and dequeue items simultaneously without locks, reducing contention and improving throughput. The queue includes features like bulk operations, memory management, and a blocking variant for synchronization.
C++ developers building high-performance, concurrent applications such as game engines, real-time systems, or parallel data processing pipelines. It is ideal for those needing efficient thread-safe data structures without the overhead of locks.
Developers choose this queue for its exceptional speed, comprehensive feature set, and robustness compared to alternatives like Boost or Intel TBB. Its single-header design, lock-free algorithm, and support for bulk operations make it both easy to integrate and highly efficient under heavy contention.
A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Benchmarks show it often outperforms alternatives like Boost and Intel TBB queues, especially with bulk operations, due to optimized lock-free design.
Just drop concurrentqueue.h into your project, making it easy to adopt without build system complications, as highlighted in the README.
Supports high-speed enqueueing and dequeueing of multiple elements at once, reducing overhead and approaching non-concurrent queue speeds under contention.
Fully lock-free and usable from any number of threads without artificial limits on element types or counts, managing memory automatically.
Elements from coordinated producers may not deque in the expected order, a limitation the README explicitly warns about, requiring workarounds like shared tokens.
Using try_enqueue requires arcane formulas to size memory correctly, with the README admitting it's non-obvious and error-prone under contention.
Lacks strong memory ordering guarantees, making correct usage difficult without deep understanding of happens-before relationships, as noted in samples.
A General-purpose Task-parallel Programming System in C++
A simple C++11 Thread Pool implementation
ArrayFire: a general purpose GPU library.
Optimized primitives for collective multi-GPU communication
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.