Expand description
A bounded, wait-free single-producer / single-consumer (SPSC) ring buffer
for scheduled TimedEvents.
One thread (e.g. the sequencer / loader) pushes events; one thread (the
audio thread) pops them. Producer and consumer touch disjoint atomics — the
producer owns tail, the consumer owns head — so neither ever blocks or
allocates. One slot of the N-element buffer is kept empty to distinguish
“full” from “empty”, giving a usable capacity of N - 1.
The events are all-integer Copy PODs, so the plain data writes carry no
interior pointers; the Acquire/Release ordering on the indices is what
publishes a written slot to the consumer. This mirrors the rtrb-style
discipline the Qualia hot path uses without pulling in a dependency.
Structs§
- Event
Ring - A fixed-capacity SPSC ring of
Nslots (usable capacityN - 1).