How does deadlock detection and recovery work when the OS allows deadlocks to occur?

Last updated 5 July 2026

  • Detection runs periodically: cycle search in a wait-for graph for single-instance resources, or a Banker-style completion check for multi-instance ones. Check frequency trades CPU cost against detection delay.

  • Recovery breaks the circular wait by killing deadlocked processes (all, or one lowest-cost victim at a time) or by preempting resources and rolling the victim back to a checkpoint.

  • To avoid starvation, include how often a process has been rolled back in the victim cost.

  • https://parashar--manas.medium.com/understanding-operating-system-deadlock-part-48-deadlock-detection-and-recovery-96528af29e9c
  • https://operatingsystemsauthority.com/deadlock-in-operating-systems/
  • https://www.tutorialspoint.com/operating_system/os_deadlock_detection_and_recovery.htm
  • https://www.groundcover.com/learn/performance/deadlock-detection
  • https://byjus.com/gate/deadlock-detection-and-recovery-in-operating-system-notes/
  • https://medium.com/@ayoadeakin234/operating-systems-ii-week-4-59446abbba78
All Operating Systems interview questions