Expand description
Cooperative scheduling: the budget of operations each poll of a task may
complete before it yields to the other tasks of its shard. IO that
completes spends one, and so do the receives, acquires and locks of
sync that complete without queueing (see its module
docs).
Structs§
- Cooperative
- The future of
cooperative. - Unconstrained
- The future of
unconstrained.
Constants§
- BUDGET
- Operations one poll of a task may complete before it yields.
Functions§
- consume_
budget - Spends one operation of the budget, yielding first when it is spent: a loop of work that awaits nothing else can call it to stay fair.
- cooperative
- Runs
futureunder the budget: each of its polls spends one operation, and it yields instead of being polled when the budget is spent. - has_
budget_ remaining - Whether the current poll has budget left (always
trueoutside a poll and in anunconstrainedone). - unconstrained
- Runs
futurewith no budget: none of its operations spends any, and it never yields for the budget’s sake.