Operating Systems
Unit 5: Deadlock
From deadlock characterization to Banker's Algorithm — master numerical problems, resource allocation graphs, and prevention strategies used in real operating systems.
⏱️ Time to Complete: 7 hrs theory + 5 hrs lab | 💰 Earning Potential: ₹8K–₹25K/month | 📝 30 MCQs (Bloom's Mapped)
💼 Jobs this unlocks: Systems Engineer (₹6–10 LPA) | Site Reliability Engineer (₹8–18 LPA)
Opening Hook — The Deadlock You Can See
🚗 Mumbai's Chandni Chowk Lane — Two Autos, Zero Movement
Picture this: a narrow lane in Mumbai's Chandni Chowk area. Two auto-rickshaws enter from opposite ends — nose-to-nose. Neither can reverse because behind each auto, 50 more autos have queued up. The lane is barely wide enough for one vehicle. Auto A holds position in the left half and needs the right half to pass. Auto B holds position in the right half and needs the left half to pass. Both hold what the other needs. Neither will back down.
The entire lane is DEADLOCKED. Traffic police arrive, but even they can't solve it without forcibly towing one auto (preemption) or making all autos in one direction reverse (rollback). Now imagine this happening inside your operating system — but instead of autos, there are 4 processes, and instead of lane space, they hold printers, memory blocks, and disk drives.
"Could YOU have prevented this?" — That's exactly what this unit teaches. You'll learn to detect, prevent, avoid, and recover from deadlocks. And you'll solve Banker's Algorithm numericals that appear in every OS exam.
Learning Outcomes — Bloom's Taxonomy Mapped
| Bloom's Level | Learning Outcome |
|---|---|
| 🔵 Remember | List the 4 necessary conditions for deadlock and define safe/unsafe states |
| 🔵 Understand | Explain why circular wait + hold & wait cause deadlock using RAG diagrams |
| 🟢 Apply | Execute Banker's Algorithm step-by-step: compute Need matrix, find safe sequence, evaluate resource requests |
| 🟢 Analyze | Analyze Resource Allocation Graphs to detect cycles and determine if deadlock exists |
| 🟠 Evaluate | Compare prevention vs avoidance vs detection strategies and recommend the best approach for given scenarios |
| 🟠 Create | Implement a complete Banker's Algorithm simulator in Python and build a RAG visualizer |