Intermediate Topic 23 of 51 Operating Systems
Deadlock
Cycle of tasks each waiting for resources held by another.
How it works
Deadlock needs four conditions: mutual exclusion, hold and wait, no preemption and circular wait. Break any one to prevent it.
Where it is used
Two threads each holding one lock and wanting the other.
Common pitfall
Detect with wait-for graphs; avoid by ordering locks globally.
Where it fits in the course
Deadlock is topic 23 of 51 in Operating Systems, rated Intermediate. It follows Monitors. The next topic is Deadlock Prevention and Avoidance.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Operating Systems quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Deadlock?
Cycle of tasks each waiting for resources held by another. It belongs to Operating Systems and is an intermediate-level topic.
Where do people use Deadlock?
Two threads each holding one lock and wanting the other.
What is the most common mistake with Deadlock?
Detect with wait-for graphs; avoid by ordering locks globally.
What should I learn before this topic?
Start with Monitors, the topic just before it in Operating Systems.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Operating Systems quiz.
Is Deadlock hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Deadlock?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Deadlock?
Monitors, Deadlock Prevention and Avoidance, Semaphores are closely connected. The full list is in the related topics section of this page.
What should I study after Deadlock?
Continue with Deadlock Prevention and Avoidance, the next topic in Operating Systems.
Related topics
- Monitors (Operating Systems)
- Deadlock Prevention and Avoidance (Operating Systems)
- Semaphores (Operating Systems)
- Dining Philosophers (Operating Systems)