Pulp
1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
runtime.hpp
Go to the documentation of this file.
1
#pragma once
2
3
// Convenience header — includes all runtime utilities
4
//
5
// ── Thread synchronization strategy ─────────────────────────────────────
6
//
7
// Pulp uses different primitives depending on the data flow pattern:
8
//
9
// | Pattern | Primitive | Example |
10
// |----------------------------|------------------|------------------------------|
11
// | Single value, latest-wins | std::atomic<T> | Parameter values, flags |
12
// | Multi-field coherent read | SeqLock<T> | Transport state (tempo+beat) |
13
// | Large data swap | TripleBuffer<T> | Wavetables, IR buffers |
14
// | Ordered event stream | SPSC FIFO | MIDI events, UI commands |
15
// | Occurrence signals/counts | ActivityChannel | Pad flashes, UI triggers |
16
// | Latest-value metering | TripleBuffer<T> | Audio→UI meter data |
17
// | Prepared read-only pointer | RealtimeResourceSlot<T,N> | prepared samples/IRs |
18
//
19
// RealtimeResourceSlot is a raw-pointer publication helper, not reader-pinned
20
// RCU: one non-RT owner serializes publish/reclaim and reclaims only after a
21
// block-boundary grace point. Use the Slot/Handoff taxonomy where a site needs
22
// multi-reader pins or audio-thread ownership transfer.
23
//
24
// NEVER use on the audio thread:
25
// std::mutex, std::condition_variable, heap allocation, I/O
26
//
27
// Memory ordering:
28
// - ParamValue uses relaxed atomics (independent single values, no ordering
29
// dependency between parameters)
30
// - SeqLock uses acquire/release (ensures coherent multi-field snapshots)
31
// - TripleBuffer uses acquire/release on the flag word
32
// - EventLoop uses acquire/release + condition_variable (UI thread only)
33
// - RealtimeResourceSlot publishes a prepared pointer with release/acquire;
34
// reclaim retired resources away from the audio thread after a grace point
35
36
#include <
pulp/runtime/assert.hpp
>
37
#include <
pulp/runtime/activity_channel.hpp
>
38
#include <
pulp/runtime/alive_token.hpp
>
39
#include <
pulp/runtime/background_job.hpp
>
40
#include <
pulp/runtime/cancel.hpp
>
41
#include <
pulp/runtime/log.hpp
>
42
#include <
pulp/runtime/fixed_function.hpp
>
43
#include <
pulp/runtime/log_sink.hpp
>
44
#include <
pulp/runtime/node_abi.hpp
>
45
#include <
pulp/runtime/scope_guard.hpp
>
46
#include <
pulp/runtime/spsc_queue.hpp
>
47
#include <
pulp/runtime/system.hpp
>
48
#include <
pulp/runtime/seqlock.hpp
>
49
#include <
pulp/runtime/triple_buffer.hpp
>
50
#include <
pulp/runtime/external_input.hpp
>
activity_channel.hpp
Lock-free occurrence signals between realtime and control/UI threads.
alive_token.hpp
assert.hpp
background_job.hpp
cancel.hpp
external_input.hpp
fixed_function.hpp
FixedFunction<Signature, Capacity> - a move-only callable wrapper with inline storage that never touc...
log.hpp
log_sink.hpp
node_abi.hpp
scope_guard.hpp
seqlock.hpp
Lock-free sequence-lock for coherent multi-field snapshots.
spsc_queue.hpp
system.hpp
triple_buffer.hpp
Lock-free latest-value publication between two threads.
core
runtime
include
pulp
runtime
runtime.hpp
Generated by
1.15.0