Deadlock Recovery

By | September 25, 2021

Deadlock Recovery

  • Once the deadlock has been detected in the system, the system should now be recovered from this state.
  • There is must because it will continuously degrade the performance of the system.
  • If no correction mechanism is applied, there is a possibility of total system failure.

There are two different methods used to recover from the deadlock state:

  1. Process termination
  2. Resource preemption

1. Process Termination

One way to recover from deadlock state is to abort the deadlocked processes and reclaim all the resources allocated to them.

There are two different approaches for this :

  1. Abort all deadlocked processes
  2. Abort one process at a time until the deadlock cycle is eliminated

While selecting one of the deadlocked processes for abortion several factors must be kept in mind :

  1. Priority of the process.
  2. Amount of work already done by the process and amount of work that is still to be done.
  3. The type and the number of resources the process has used.
  4.  The number of resources that a process still need in order to complete.
  5. Whether the process is batch or interactive.

2. Resource preemption

In this technique, the some resources are preempted from processes and are given to other processes till the deadlock cycle is broken. There are three issues related to resource preemption :

  • Which resources and which process should become the target of preemption?
  • What should be done with the preempted process ?
  • How to ensure that starvation will not occur in the system ?

Leave a Reply

Your email address will not be published. Required fields are marked *