Labs / Computer Science

Race Condition Lab

Two threads each try to add 1 to the same counter, over and over. But “add 1” is really three steps — read, increment, write — and when those steps interleave, an update can quietly disappear. Turn on the mutex to fix it, or switch to Manual and click a thread to schedule the steps yourself.

expected 16counter 0lost 0

What to try