Futures From the Ground Up (For Beginners, by Beginners)
summary
Implements a working single-threaded runtime: a wait_for_child future that wraps waitpid/waitid (WNOHANG semantics) and returns a ExitStatus, registers the provided Waker into a reactor hashmap keyed by PID, and yields Pending instead of blocking. The reactor blocks on waitid, calls waker.wake() for the PID, and the executor moves the task from waiting to next and polls it again. Uses Rust Future trait, Waker API and async/await and runs to completion.
AI-written summary · about
chapters (8)
- 0:00Introduction to futures
- 1:06What are futures
- 3:12Executor and reactor basics
- 7:25Implementing a future
- 12:45Task and waker system
- 19:07Executor implementation
- 23:01Reactor interface
- 24:47Closing observations








