AlgoPlus//structures / sync-problems
Read the theory

Classical Sync Problems

The textbook concurrency puzzles — and the coordination that makes them correct.

Problem
Dining
Step
1/1
State
running
Problem
Legend
Thinking
Hungry
Eating
AI Tutor Workspace
In a nutshell
Three textbook stories capture the everyday hazards of programs sharing things. Five philosophers reaching for shared forks can all freeze at once (deadlock). A producer filling a fixed shelf and a consumer emptying it must never overflow it or take from it empty. Many people can read a document together, but a writer needs it alone. Each is fixed by the right coordinating signals plus one rule that rules out the bad timing.
Ready
Press play to begin the cinematic walkthrough.
The classic puzzles distil real concurrency bugs: shared forks that deadlock (philosophers), a buffer that mustn't over/underflow (producer-consumer), and shared-vs-exclusive access (readers-writers). Each is solved by the right semaphores and a rule that breaks the bad interleaving.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Classical Sync Problems.