Inside the ComputerConcurrency

Deadlock

Two programs can wait for each other forever

Your laptop freezes: nothing crashes, nothing happens, the cursor just waits. What could two programs possibly be waiting for?

You'll find out

  • How two sensible programs freeze forever
  • Why five philosophers starve
  • How computers break the standoff

Why it matters

Databases, apps and operating systems run many things at once, and every one of them has to dodge this trap.

About 3 min6 interactive slides · 5 questionsLesson 240 · Zone 27

Play this lesson

Free to play in your browser or on iPhone

More in this zone

  1. 235Wireless SecurityThe Relay TheftThieves can stretch your car key's signal from inside your house
  2. 236Distributed SystemsThe Byzantine GeneralsHow do you agree on a plan when some messengers lie?
  3. 237RelativityTime Runs Faster UpstairsAtomic clocks tick faster just 33 centimeters higher
  4. 238Phase TransitionsWater That Freezes on CommandA quiet liquid can stay below freezing until something disturbs it
  5. 239Threat AnalysisThe 99% Test That's Usually WrongWith a rare condition, most positive results can be false alarms
  6. 241Wireless CommunicationWhy Wi-Fi Slows Down in a CrowdOnly one device can speak on a channel at a time
  7. 242Computational PhotographyPanorama GlitchesMoving people turn into monsters in panoramic photos
  8. 243AlgorithmsBill Gates' Pancake ProblemHis only research paper was about flipping pancakes