Concurrency

Threads, shared state, and the modern toolbelt — the capstone after imperative and object-oriented programming.

The Illusion of Simultaneity

We teach programming as a strictly linear sequence — one statement after another, one truth at a time — and then hand students machines with a dozen cores and programs with hundreds of threads. This page is the bridge…

The Shared Mutability Disaster

Concurrency bugs have a reputation for being mystical. They are not — they are the entirely predictable consequence of one combination: state that is shared between threads and state that mutates . Either alone is safe.…

The Concurrent Toolbelt

Raw new Thread(...) is concurrency's goto : legal, occasionally necessary, and almost never the right first move. Modern platforms provide a toolbelt of higher abstractions that manage the dangerous parts for you. This…