Io module

Fiber

structSource

One fiber. Treat it as opaque: use Fiber_Handle to refer to one from outside the scheduler.

Fields

ctx: Fiber_Context
stack: Stack
canceled: bool
Set by cancel; makes every blocking call return .CANCELED.
scheduler: *Scheduler
id: u64
generation: u64
Bumped each time the fiber ends, so a stale Fiber_Handle is recognised.
next: *Fiber
Ready queue and pool links.
all_previous: *Fiber
All live fibers.
all_next: *Fiber
entry: Spawn_Entry
data: *void
wake_reason: Io_Error
What park returns when the fiber is woken.
waiter: *Waiter
What the fiber is queued on while it is blocked, to take it off again when it is canceled.
timer_slot: s64
op: *Op
The engine operation this fiber is blocked in, and the name lookup, if any.
job: *Resolve_Waiter
deadline: s64
Absolute now_nanoseconds() limit for every IO call (0: none), set by with_deadline.
grace_depth: s32
How many with_grace blocks are running; a cancel that comes meanwhile waits in cancel_held until the outermost one ends.
cancel_held: bool
platform_code: s32
The system's error number behind the last failed IO call.
fiber_context: #Context
temporary_storage: Temporary_Storage
temporary_ready: bool

See also