4 lessons
Race conditions and the critical section problem
Why two threads doing something as simple as adding 1 to a shared number can silently produce the wrong answer.
Locks and mutexes — the bathroom key trick
The simplest tool for enforcing mutual exclusion, how it's actually built on hardware, and the real cost of getting it wrong.
Semaphores and monitors — counting turns and tidy rooms
A more flexible tool than a plain lock for managing limited resources, and a cleaner, safer way to package synchronization altogether.
The classic synchronization problems, solved from scratch
Producer-consumer, readers-writers, and dining philosophers — the three textbook puzzles that every synchronization tool gets tested against.