Context
The problem
Classic concurrency problems are easy to explain and very easy to get slightly wrong.
Approach
How I built it
POSIX threads and semaphores keep each batch in step.
A first-come, first-served queue with checks so nobody waits forever.
Animated terminal logs, so you can actually watch the threads take turns.
Result
What came out of it
No deadlocks or starvation
Fair ordering
Concurrency you can watch