DSA Factory
All free lessons
Operating systems

Free Deadlocks lessons

6 lessons, about 1½ hours in all. Each teaches one idea with a visual, then gives you a problem or a few questions on it. Read the lessons here, then create a free account to practise and keep your progress.

Stage 0What a deadlock is

  1. The four conditionsSee how two threads and two locks can freeze each other, and the four things that must all be true for it.12 min
  2. Resource-allocation graphsDraw who holds and who wants what, and learn when a cycle in the picture means deadlock.13 min
  3. Four ways to handle deadlockCompare ignoring it, preventing it, avoiding it and detecting it, and which real systems pick which.13 min

Stage 1Avoidance and detection

  1. Safe states and the banker's algorithmWork out whether a state is safe, and find the order in which every process can finish.15 min
  2. Granting a requestUse the safety check to decide whether a process's request can be granted now, delayed, or must be refused.13 min
  3. Detecting and recoveringLet deadlock happen, find the stuck processes with the same kind of check, and break it.13 min

All of Deadlocks is free

That’s the whole topic, from the first idea to the mastery stage, with no card needed. Create a free account to practise, keep your progress and carry on to the next topic.

Create your free account