Expand description
TaskPool: a minimal bounded async executor, no external runtime.
The substrate’s rings are executor-agnostic (any std::future
executor drives them). TaskPool is the proof that “any” includes
“a tiny one we ship ourselves”: a fixed pool of worker threads
running an arbitrary number of suspended tasks. There is no tokio,
no reactor, no per-task thread. A task that awaits a ring parks its
Waker in the ring (see crate::waker_ring); the producer’s push
fires that Waker, which re-enqueues the task here, and a worker
polls it. M threads, N tasks, with M fixed and N unbounded.
The ready queue is a Mutex<VecDeque> + Condvar on purpose: the
executor’s own scheduling is not the thing under test, and a
std-only queue keeps the dependency surface at zero.
Structs§
- Task
Pool - A fixed-size pool of worker threads driving an unbounded set of suspended tasks.