|
dispenso 1.6.0
A library for task parallelism
|
#include <atomic>#include <cstddef>#include <cstdint>#include <new>#include <type_traits>#include <utility>#include <dispenso/platform.h>#include <dispenso/util.h>Go to the source code of this file.
Classes | |
| class | dispenso::MpmcRingBuffer< T, Capacity, RoundUpToPowerOfTwo > |
| A lock-free multi-producer multi-consumer ring buffer with fixed capacity. More... | |
A lock-free multi-producer multi-consumer (MPMC) bounded ring buffer.
This buffer implements the Vyukov bounded MPMC queue algorithm, which uses per-slot sequence numbers for synchronization. It provides O(1) fail-fast push and pop operations with no CAS retry loops on the uncontended fast path.
The primary use case is per-thread work queues for fork-join scheduling, where a scheduler pushes targeted work to a specific thread's ring and the thread (or a work-stealing neighbor) pops from it. Bulk push is supported for efficient batch scheduling.
Definition in file mpmc_ring_buffer.h.