9 parts · 13 chapters
Concurrency and Parallelism
Concurrency is about dealing with many things at once; parallelism is about doing many things at once (Rob Pike). Every backend is concurrent; some are parallel; most concurrency bugs come from shared mutable state touched without coordination.
Nine parts: races; locks and condition variables; deadlock; lock-free basics; memory models across languages; async/await underneath; actors and CSP; Amdahl's law and parallel speedup; and one problem (a concurrent rate-limited fetcher) solved in Node, Go, Rust, Java and Python.
hazardsRaces, deadlock, livelock, starvation and priority inversion.
primitivesMutexes, condition variables, semaphores, atomics, channels.
memory modelsHappens-before, visibility, and what each language guarantees.
asyncFutures, promises, state machines and executors under async/await.
modelsShared memory, actors and CSP, and when each fits.
scalingAmdahl and Gustafson, contention, and measuring speedup.
00
Races
Concurrency and parallelism · Races without threads, and race detectors
2 ch · ~12 min01Locks and Condition Variables
Primitives across languages
1 ch · ~8 min02Deadlock, Livelock and Starvation
Deadlock and its prevention · Livelock, starvation and priority inversion
2 ch · ~12 min03Lock-Free Basics
Compare-and-swap
1 ch · ~8 min04Memory Models Across Languages
Visibility and ordering · Safe publication
2 ch · ~12 min05async/await Underneath
State machines and executors · Cancellation and structured concurrency
2 ch · ~12 min06Actors and CSP
Three models
1 ch · ~8 min07Amdahl's Law and Parallel Speedup
The serial fraction
1 ch · ~8 min08One Problem in Five Languages
The same fetcher, five ways
1 ch · ~8 minBuilt on OS and ComputersOS part 3 introduced synchronisation; Computers part 8 measured atomics and false sharing; Node part 6 covered workers. Distributed Systems is concurrency across machines.