What is the simplest way to recover from a deadlock?
2013
What is the simplest way to recover from a deadlock?
Answer: D. Terminate one of the processes — ConceptA deadlock is a circular-wait state in which each process in a set waits for a resource held by another process in that set. Recovery must break the…
- A.
Roll back a process
- B.
Preempt a resource
- C.
Lock one of the processes
- D.
Terminate one of the processes
Attempted by 488 students.
Show answer & explanation
Correct answer: D
Concept
A deadlock is a circular-wait state in which each process in a set waits for a resource held by another process in that set. Recovery must break the cycle by making at least one held resource available. The main recovery families are process termination and resource preemption.
Application
Select one process participating in the deadlock cycle as the victim.
Terminating that process releases all resources allocated to it.
At least one waiting process can then acquire a released resource, so the circular wait is broken without checkpoint restoration or resource-selection machinery.
Cross-check and contrast
Rolling back a process needs a saved checkpoint and recovery support.
Resource preemption needs a safe victim resource and state restoration, and not every resource is preemptable.
Merely locking or suspending a process does not release the resources it holds.
Result
Therefore, among the offered choices, terminating one of the processes is the simplest deadlock-recovery method, although it sacrifices that process's unfinished work.
A video solution is available for this question — log in and enroll to watch it.
Explore the full course: Mppsc Assistant Professor Computer Science Paper 2