Every concurrency visualization on this site on one map. The branches are the main ideas. Each leaf is a page; the grey line under it is the one thing to remember about it. Click a branch to focus on it, click a page to open it.
Ask what a thread does while it cannot go on, and you know the branch:
| Branch | A waiting thread... | Main tool | Classic bug |
|---|---|---|---|
| Concurrency basics | takes turns on a core | time slicing, cores | counter++ race |
| Atomics and spinning | spins on the CPU | xchg, cmpxchg | wasted CPU, ABA |
| Locks that sleep | sleeps in the kernel | futex | deadlock |
| Waiting for a condition | sleeps until signalled | semaphore, condition variable | lost wake-up |
| Classic problems | depends on the solution | all of the above | deadlock, starvation |
| Many tasks, few threads | is parked by a runtime | run queues, work stealing | blocking call stalls a thread |
counter++ is a read, an add and a write, so two threads can lose an update.while loop: a wake-up can be spurious or already stale.See all concurrency pages in the index, or the other mind maps.