Skip to main content

Module executor

Module executor 

Source
Expand description

Single-threaded async executor with work-stealing extension points.

§Run loop

block_on(future)
  └─ Executor::run_loop
       ├─ LocalQueue  (LIFO ring, 256 slots)
       ├─ GlobalQueue (Mutex<VecDeque> — waker injection)
       └─ Reactor     (kqueue/epoll — parks when no work is ready)

The loop runs until the root future (the argument to block_on) resolves. Spawned tasks are driven as side-effects of the same loop.

Modules§

scheduler
Per-core task queues: LocalQueue (ring buffer) + GlobalQueue (mutex deque).
task
Task lifecycle types: TaskHeader, Task, JoinHandle.
task_local
Task-local storage for async contexts.
waker
Custom RawWakerVTable implementation.
work_stealing
Opt-in work-stealing layer.

Structs§

Executor
Per-thread async executor.

Functions§

block_on
Drive future to completion on the current thread, returning its output.
block_on_with_spawn
Drive future to completion with spawn() available in the async context.
spawn
Spawn a future onto the current thread’s executor.