Language Runtimes · Cluster
Runtime Concurrency
Schedulers, green threads, and event loops.
- 01 Readiness Notification and the Single-Threaded Event Loop How one thread watches thousands of file descriptors through epoll or kqueue, why edge-triggered notification forces handlers to drain until EAGAIN, and where the dispatch loop stalls.
- 02 Green Threads and the Cost of a User-Space Context Switch What a green thread actually saves compared with a kernel thread, which registers a switch must preserve, and why a scheduler that lives in user space changes the blocking rules of the whole runtime.
- 03 Yield Points and What Makes a Task Cooperatively Schedulable Why a scheduler that cannot interrupt needs the compiler to place checkpoints, how the choice of checkpoint changes latency, and what a missing yield point does to every task behind it.
- 04 Readiness and Completion: Two Ways to Ask the Kernel for I/O Readiness notification tells a program when an operation can start; completion notification tells it when one has finished. The difference decides how many syscalls a runtime makes and where its buffers live.
- 05 Work-Stealing Deques and Why the Thief Takes the Oldest Task Per-worker deques with LIFO local execution and FIFO stealing keep hot data on one core, and the memory-ordering requirements that make the concurrent deque correct are narrower than they look.
- 06 Stackful and Stackless Coroutines: Where Suspension Is Allowed A stackful coroutine can suspend inside any call; a stackless one can only suspend where the compiler emitted a resume point. The difference is a per-task stack versus a state machine, and it decides which libraries a task may call.
- 07 When a Blocking Call Enters an Asynchronous Runtime A blocking system call inside a task stalls the carrier thread and every task queued behind it. What detection is possible, what a blocking pool costs, and why the boundary is drawn at the library.
- 08 Cancellation and Drop at Suspension Points Stopping a task means unwinding or abandoning whatever state it holds at the moment it was suspended. Why cancellation is safe only at suspension points, and what a partially completed operation leaves behind.
- 09 Hierarchical Timing Wheels for Millions of Timeouts A heap of deadlines costs O(log n) per insertion and O(1) to read the next one. A hashed wheel with cascading levels makes insertion O(1) and confines expiry to one bucket, at the price of resolution and a bounded maximum interval.
- 10 Fairness and Tail Latency in Task Schedulers Average latency hides the requests that wait behind a queue. How scheduler policy, queue discipline, and batching each move the tail, and why a fair scheduler can still produce an unfair system.