Struct std::LocalExecutor
struct LocalExecutor {
?&TaskHeader head;
?&TaskHeader tail;
int live;
int notified;
int root_woken;
struct TimerQueue timers;
long long polls;
}The single-threaded, no-heap executor (see the top of this file).
Fields
live tasks, in spawn order
spawned and not finished
atomic: some task (or the block_on root) was woken
atomic: block_on's own future was woken
statistics: task polls so far
Methods
Start running 'task' (returns its handle). The task joins the end of the poll order and is polled on the next round.
One round: poll every task woken when its turn in the spawn order comes (a task woken by one later in the order waits for the next round). Doesn't advance the timers or wait. Returns the polls made.
Advance the timer queue to now_ms (firing what is due), then one round. Returns the polls made.
Run until every spawned task has finished: rounds, with the timers advanced by the Park's clock before each, parking on 'park' whenever nothing is runnable. A task that keeps waking itself doesn't stop timers from firing.
Run 'fut' (and every spawned task, meanwhile) until 'fut' is Ready; returns its value. Spawned tasks that are still running stay spawned.
some task is woken
Releases the timer queue. Spawned tasks are owned by their AsyncTask storage, not by the executor: finish or abort them first.