Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_reactor_t Struct Reference

#include <internal.h>

Collaboration diagram for srn_reactor_t:
[legend]

Data Fields

srn_context_tctx
const srn_reactor_backend_tbackend
 The chosen kernel mechanism and its private state, set at activation.
void * backend_state
srn_reactor_notify_fn notify
 Wakes the worker that owns a channel a completion landed on.
srn_reactor_io_channel_tchannels
 One channel per worker, there is a 1to1 mapping between worker ids and channel ids.
size_t nchannels
size_t ring_capacity
 Capacity of every ring (1 << ring_magnitude), fixed at activation.
srn_thread_t thread
 The reactor thread and its run flag.
_Atomic bool running
_Atomic size_t inflight
 Operations submitted but not yet consumed, across all channels.
pqmh_t timers
 Pending timers (like SLEEP, and IO deadlines) as a min-heap keyed by absolute monotonic deadline.

Detailed Description

Definition at line 43 of file internal.h.

Field Documentation

◆ backend

const srn_reactor_backend_t* srn_reactor_t::backend

The chosen kernel mechanism and its private state, set at activation.

Definition at line 47 of file internal.h.

◆ backend_state

void* srn_reactor_t::backend_state

Definition at line 48 of file internal.h.

◆ channels

srn_reactor_io_channel_t* srn_reactor_t::channels

One channel per worker, there is a 1to1 mapping between worker ids and channel ids.

Basically their index in their respective array should match

Definition at line 56 of file internal.h.

◆ ctx

srn_context_t* srn_reactor_t::ctx

Definition at line 44 of file internal.h.

◆ inflight

_Atomic size_t srn_reactor_t::inflight

Operations submitted but not yet consumed, across all channels.

Quiescence needs this to reach zero. Bumped on submit, dropped by the consumer through srn_reactor_op_done once the waiting fiber is readied.

Definition at line 71 of file internal.h.

◆ nchannels

size_t srn_reactor_t::nchannels

Definition at line 57 of file internal.h.

◆ notify

srn_reactor_notify_fn srn_reactor_t::notify

Wakes the worker that owns a channel a completion landed on.

Set at activation.

Definition at line 52 of file internal.h.

◆ ring_capacity

size_t srn_reactor_t::ring_capacity

Capacity of every ring (1 << ring_magnitude), fixed at activation.

Also each channel's in-flight cap; see srn_reactor_submit.

Definition at line 61 of file internal.h.

◆ running

_Atomic bool srn_reactor_t::running

Definition at line 66 of file internal.h.

◆ thread

srn_thread_t srn_reactor_t::thread

The reactor thread and its run flag.

The thread loops until running is cleared and it is roused.

Definition at line 65 of file internal.h.

◆ timers

pqmh_t srn_reactor_t::timers

Pending timers (like SLEEP, and IO deadlines) as a min-heap keyed by absolute monotonic deadline.

Created at activation, owned and touched only by the reactor thread (THIS IS NOT THREAD SAFE, so only the reactor should manage it). See the timer helpers in reactor.c.

Definition at line 77 of file internal.h.


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