Skip to main content

Module coop

Module coop 

Source
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 future under 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 true outside a poll and in an unconstrained one).
unconstrained
Runs future with no budget: none of its operations spends any, and it never yields for the budget’s sake.