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 processesConceptA 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…

  1. A.

    Roll back a process

  2. B.

    Preempt a resource

  3. C.

    Lock one of the processes

  4. 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

  1. Select one process participating in the deadlock cycle as the victim.

  2. Terminating that process releases all resources allocated to it.

  3. 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

Loading lesson…