Let's write an async runtime
summary
Builds a tiny single‑threaded Rust executor that implements block_on and spawn, boxes futures as a pinned boxed future, and first uses a busy loop then replaces it with a thread waker (std::thread::unpark + Waker/Context). Tests use nonblocking UnixStream pipes; proof of concept works but spawns a thread per wait, wastes CPU and can exhaust file descriptors, so it’s educational and functional but not production‑grade.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 2:15Async functions and futures in Rust
- 7:14Async functions compile to futures
- 9:23Pinning and self-referential types
- 16:50Why pinning is essential
- 20:21Executor trait for naive runtime
- 27:29Naive IO stream for testing
- 33:52Problems with naive runtime
- 38:11Waker and context for tasks
- 42:26Runtime with threads and wakers
- 43:49Live demo of runtime
- 48:24Q&A
- 55:25Q&A
- 1:03:04Summary








