MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Memory::SingleThreadedPolicy Struct Reference

Non-atomic single-threaded operation. More...

#include <RingBuffer.hpp>

+ Collaboration diagram for MayaFlux::Memory::SingleThreadedPolicy:

Classes

struct  State
 

Static Public Attributes

static constexpr bool is_thread_safe = false
 
static constexpr bool requires_trivial_copyable = false
 
static constexpr bool requires_fixed_storage = false
 

Detailed Description

Non-atomic single-threaded operation.

Provides minimal overhead when all access is from a single thread or when synchronization is handled externally (e.g., mutex-protected).

Thread Safety:

  • NO thread synchronization
  • Use when externally synchronized OR single-threaded

Benefits:

  • No atomic overhead (~2-5 CPU cycles faster per operation)
  • Works with any element type (no TriviallyCopyable requirement)
  • Compatible with both FixedStorage and DynamicStorage

When to Use:

  • DSP delay lines in audio callback (single thread)
  • Polynomial node history buffers (single thread)
  • Non-realtime data structures
  • Already protected by external mutex
// Single-threaded delay line for audio DSP
using AudioDelay = RingBuffer<double,
HomogeneousAccess>;
void audio_process_callback() {
AudioDelay delay(1000); // No thread sync overhead
delay.push(input_sample);
auto delayed = delay.peek_oldest();
}
Policy-driven unified circular buffer implementation.
Runtime-resizable storage using std::vector.
Non-atomic single-threaded operation.

Definition at line 216 of file RingBuffer.hpp.


The documentation for this struct was generated from the following file: