Inside the ComputerConcurrent Computing

The Race Condition

Correct steps can go wrong when they happen at the same moment

Two phones, one account, both tapped at the same moment. Every step the bank takes is right. So how does it pay twice?

You'll find out

  • How two correct requests go wrong
  • The simple lock that fixes it
  • Why tests rarely catch it

Why it matters

Banks, ticket sites and power grids all juggle requests at once, and a race between them can cost real money.

About 3 min6 interactive slides · 5 questionsLesson 259 · Zone 29

Play this lesson

Free to play in your browser or on iPhone

More in this zone

  1. 253Attention DesignThe Red DotA tiny badge turns an unfinished task into an itch
  2. 254Protocol SecurityWhy Car Keys Never Repeat ThemselvesEach press of your fob sends a code that will never work again
  3. 255Atomic PhysicsYou've Never Touched AnythingElectrons push back before atoms ever meet
  4. 256Physical ChemistryWhy Pasta Cooks Slowly on EverestWater boils at a lower temperature when the air is thin
  5. 257Space ComputingThe Computer That Flew to the MoonApollo's guidance computer had about 4 KB of working memory
  6. 258Space ComputingApollo's 1202 AlarmMinutes before landing on the Moon, the computer started flashing errors
  7. 260Cellular NetworksWhy It's Called a Cell PhoneThe land is divided into ‘cells’ that reuse the same radio frequencies
  8. 261Display TechnologyDark Mode Saves Battery, SometimesOn OLED screens black pixels are switched off