The Concurrency Lab
Cores, workers, CPU time, I/O time and a critical section — five dials over one model. Turn them and watch throughput, latency, utilization and effective parallelism move together. The lab exists to make one thing visible: adding workers is not adding capacity, and a lock does not care how many cores you bought.
Concurrency lab
Move one dial at a time and name the constraint before you read the verdict. The verdict is generated from the same numbers as the meters, so prose and figures cannot drift apart.
They come from a queueing and contention model inside Engineer Atlas. What is faithful is the behaviour: work that waits benefits from more workers, work that computes does not, a wide critical section pins parallelism near 1 no matter how many cores you buy, and arrivals past capacity produce an unbounded queue rather than a large latency. Real arrivals are burstier than this model assumes, so real systems reach every one of these walls earlier than the sliders suggest. Do not quote a millisecond from this page.
Scheduler timeline
The same configuration as lanes over time. Running, ready, waiting, blocked, idle — the picture that makes 'the CPU is only 30% busy and everything is slow' obvious.
What the model reproduces faithfully
These are the behaviours worth learning from this page. Each one is a property of concurrent systems, not of this simulator.
- Work does not overlap on one core. Concurrency without parallelism hides *waiting*; it never adds compute.
- A critical section serialises whatever fraction of the work it covers, so speedup collapses toward 1 as that fraction grows — no matter how many cores you add.
- A queue whose arrival rate exceeds its service rate has no steady state. Latency is then not large, it is unbounded — the model says so rather than inventing a number.
- Workers beyond the point where a shared resource saturates buy nothing and cost context switches.
- A cycle in a wait-for graph is a deadlock, and no amount of waiting resolves it.
- Arrivals are a smooth rate, not a burst process. Real traffic is burstier, so real systems queue earlier than this shows.
- Context-switch cost is a flat constant. The real cost depends on cache footprint and is usually worse.
- The speedup model composes Amdahl with a synchronisation term and a bandwidth ceiling. Real curves have more causes and are rarely this smooth.
- Nothing here knows your language, runtime, OS scheduler or CPU — and all four change the answer.
Where to take a reading next
The lab shows what a configuration does. These pages ask you to decide first.
Drive the scheduler yourself and try to break the invariant before you are shown how.
Predict what each button does to latency, throughput and CPU, then watch the model disagree.
Ten CPU-heavy tasks, then a million. The right answer changes twice on the way up.