Skip to main content

Module continuation

Module continuation 

Source

Structs§

Continuation
A continuation is a green thread that can be resumed and yielded at will. We use it to execute a “thread” from within a Future.
ContinuationPool
A ContinuationPool just holds on to old Continuations that are reusable, and vends them back out again. This amortizes the cost of allocating continuations, which involve allocating new stacks (mmap), mprotect, etc.
PooledContinuation
A thin wrapper around a Continuation that returns it to a ContinuationPool when dropped, but only if it’s reusable.

Enums§

ContinuationInput
Inputs that we can pass to a continuation.
ContinuationOutput
Outputs that a continuation can pass back to us

Statics§

CONTINUATION_POOL

Functions§

switch
Possibly yield back to the executor to perform a context switch. This function should be called before any visible operation. If each visible operation has a scheduling point before it, then there will be a potential context switch in between any pair of visible operations, which is a necessary condition for completeness.