|
MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
|
Lock-free SPSC (Single Producer Single Consumer) concurrency. More...
#include <RingBuffer.hpp>
Collaboration diagram for MayaFlux::Memory::LockFreePolicy:Classes | |
| struct | State |
Static Public Attributes | |
| static constexpr bool | is_thread_safe = true |
| static constexpr bool | requires_trivial_copyable = false |
| static constexpr bool | requires_fixed_storage = true |
Lock-free SPSC (Single Producer Single Consumer) concurrency.
Implements wait-free push and lock-free pop using C++20 atomic operations with careful memory ordering. Designed for real-time producer threads writing to non-realtime consumer threads.
Thread Safety:
Memory Ordering:
SPSC Safety with Non-Trivial Types: Unlike MPMC (multi-producer multi-consumer), SPSC queues are safe for non-trivially-copyable types because:
buffer[i] = value is sequentially consistent per slotThis means InputValue with std::string/std::vector is SAFE here. The atomic indices synchronize which slots are readable/writable, but the actual data copy happens in exclusive ownership.
Requirements:
Performance:
Definition at line 159 of file RingBuffer.hpp.