srn_error_tag_t
The kind of a failure.
srn_error_t * srn_reactor_errors_static(srn_error_tag_t tag)
Return the shared, immutable error for an IO failure tag.
void srn_reactor_post_completion(srn_reactor_t *reactor, size_t channel, srn_reactor_io_completion_t completion)
Post a finished operation to channel's completion queue and rouse the channel's worker through the no...
A generic priority queue backed by a binary min-heap.
void(* srn_reactor_notify_fn)(srn_scheduler_t *sched, size_t channel)
The interface that the scheduler supplies so the reactor can announce that a channel has completions,...
A mutable single producer, single consumer ring of fixed size elements.
A runtime error, a tag classifying the failure and a human-readable message.
One async system behind the reactor contract.
A channel, the per-worker submission and completion ring pair.
size_t inflight
Operations submitted on this channel and not yet consumed.
A completion, the result of one submission, echoed back on the channel.
srn_thread_t thread
The reactor thread and its run flag.
pqmh_t timers
Pending timers (like SLEEP, and IO deadlines) as a min-heap keyed by absolute monotonic deadline.
srn_reactor_io_channel_t * channels
One channel per worker, there is a 1to1 mapping between worker ids and channel ids.
srn_reactor_notify_fn notify
Wakes the worker that owns a channel a completion landed on.
size_t ring_capacity
Capacity of every ring (1 << ring_magnitude), fixed at activation.
const srn_reactor_backend_t * backend
The chosen kernel mechanism and its private state, set at activation.
_Atomic size_t inflight
Operations submitted but not yet consumed, across all channels.
srn_thread_t, srn_mutex_t, and srn_cond_t model the thread-level operations the runtime needs,...