Expand description
A multi-threaded, priority-aware executor (feature std).
MultiExecutor runs Send futures on a fixed set of worker threads that share one ready
queue:
- Priorities. A worker always takes the ready task with the highest priority; tasks of
equal priority run in the order they became ready (FIFO), as on the single-core
Executor. Priorities can change while a task waits; it is re-queued under its new priority without losing its place among equals. - Fairness. Strict priorities starve: a busy high-priority task can keep lower ones from
ever running. With
MultiExecutor::with_fairness(n), everyn-th task a worker takes is the one that has been ready the longest, whatever its priority. A ready task then waits at most aboutntimes the number of tasks ahead of it in age order. - Bounded cooperation. A task that never awaits cannot be interrupted by any cooperative
executor.
#[psync::graph(yield_every = N)]insertsyield_noweveryNloop iterations of an async function, so long loops give the scheduler a chance to run higher-priority work.
Wakes are never lost: a task woken while it is being polled is re-queued as soon as the poll returns (the usual idle / queued / running / notified state machine).
Structsยง
- Cell ๐
- Cell
Waker ๐ - Multi
Executor - A priority-aware executor running
Sendfutures on worker threads. - Multi
Handle - Changes the priority of, wakes, or checks a task of a
MultiExecutor. - Queue ๐
- Shared ๐
Constantsยง
Functionsยง
Type Aliasesยง
- Job ๐