This is a C++ library that solves a specific, narrow problem: passing data quickly between exactly two threads, where one thread produces data and the other consumes it. The author designed the queue from scratch specifically for this two-thread setup. If you need to share data across more than two threads simultaneously, this library is not the right fit, and the README points to a sibling project for that case. The core idea is a lock-free queue, which means threads never have to wait for each other to release a shared lock before reading or writing. Instead, the design uses lower-level techniques that let both threads operate mostly without blocking. The result is very low overhead per item, and both the add and remove operations always complete in constant time, meaning performance does not degrade as the queue grows. The library comes as a pair of header files you drop directly into your project source, no separate compilation or installation required. You create a queue, call enqueue to add items and try_dequeue to remove them. There is also a blocking variant where the consumer thread can wait until something arrives rather than repeatedly checking. A circular buffer version with a fixed capacity is available too, which can block both on adding and removing. For projects using CMake, a standard FetchContent block can pull the library in automatically at build time. Alternatively, you can install the headers into your system directories and include them like any system library. One important limitation noted in the README: the library works correctly on all modern processor families, including x86, ARM, and PowerPC, but is not suitable for the older DEC Alpha architecture due to that chip's unusual memory ordering rules. The license is simplified BSD, which allows free use in personal and commercial projects.
← cameron314 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.