An industrial-strength lock-free queue that's faster than Boost or TBB

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

C++ developers building multi-threaded producer-consumer systems get a battle-tested, header-only queue that benchmarks faster than Boost and TBB with zero build friction.

Read this as

A programmer named Cameron publishes a free C++ building block called moodycamel::ConcurrentQueue, a single file that lets many parts of a program safely share data without waiting on each other. It does this without locks, which are the usual bottleneck, and tests faster than the popular alternatives Boost and Intel's TBB. Anyone writing high-performance C++ software can use it today.

A mature open-source alternative to the standard Boost and TBB queues is available as a single C++11 header with no dependencies or licensing drama to manage. Benchmarks in the repository show it outperforming both competitors, which matters where queue contention limits throughput. It is already used in production systems, reducing integration and performance risk. The article gives no cost figures since the library is free.

moodycamel::ConcurrentQueue (github.com/cameron314/concurrentqueue) is a header-only C++11 lock-free multi-producer/multi-consumer queue. It beats boost::lockfree::queue and tbb::concurrent_queue in many repo benchmarks by using per-thread caches and granular design that avoids a single contended atomic pointer, reducing cache-line bouncing. Memory is managed internally via a slab-like allocator, and a blockingconcurrentqueue.h variant supports blocking dequeue via a lightweight semaphore. The article states no absolute benchmark numbers, only relative wins.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

moodycamel::ConcurrentQueue Boost TBB concurrentqueue.h blockingconcurrentqueue.h GitHub

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

datasette-charts 0.5a0

Datasette Charts 0.5a0 adds calendar heatmaps, box plots and active-over-time charts, enabling richer data visualisation directly in the browser without extra libraries.