A C++ concurrency lab exploring bounded SPSC and MPMC queue implementations, atomic memory ordering, cache behavior, move-only object support, and performance experiments.
This is a learning and experimentation repository, not a production-ready concurrent queue library.
The queue projects were extracted from a larger collection of C++ practice projects while preserving their original development history.
The spsc/ directory contains an experimental bounded single-producer,
single-consumer ring buffer.
The development history includes experiments with:
- atomic producer and consumer indices;
- acquire/release memory ordering;
- move-only element support;
- cache-line separation;
- bounded-buffer full and empty conditions;
- throughput measurements.
Relevant files:
spsc/lock_free_queue.h— queue implementation.spsc/lock_free_queue.cpp— test and performance driver.spsc/stats_data_for_improvements.txt— historical measurement notes.
The mpmc/ directory contains an experimental bounded multi-producer,
multi-consumer queue using per-slot sequence numbers.
The implementation explores:
- independent enqueue and dequeue positions;
- compare-and-exchange slot reservation;
- per-slot publication sequences;
- placement construction and explicit destruction;
- move-only element support;
- contention and retry behavior.
Relevant files:
mpmc/mpmc_queue_bounded.h— queue implementation.mpmc/mpmcQ_bounded_test.cpp— original test and exercise program.mpmc/ProgressLog.md— historical development notes.
The bounded MPMC queue is used as the mailbox implementation in Actor-System-Lab-cpp.
The historical source has been preserved, but the repository has not yet been revalidated as a clean standalone build after extraction. A unified root build system and systematic correctness tests remain future work.
The implementations should be treated as experimental until their concurrency contracts and supported type requirements are formally documented and tested.