Skip to main content
PRISM

Concurrency, enumerated

A concurrent program does not have a behaviour. It has a set of them, one per valid interleaving of its threads — and the bug is almost never in the ordering you imagined. Every concept here enumerates that set and marks the members that are wrong.

7 concepts · every one runnable · start with the lost update

Races and atomicity

What an increment actually is, why a question can go stale between asking and acting, and the outcome space that appears the moment two threads touch one variable.

Mutual exclusion

Locks, and what they do to the set of possible orderings. Granularity, deadlock and its cycle, livelock, starvation, and the reentrancy that stops a lock deadlocking against itself.

Memory and hardware

Where the interleaving model runs out. Store buffers producing outcomes no ordering explains, the barriers that forbid them, false sharing, and the ceiling Amdahl puts on all of it.