web analytics


Recovery From Deadlock: -When a detection algorithm determines that a deadlock exists, then the system or operator is responsible for handling deadlock problem. There are two options for breaking a deadlock.

  1. Process Termination
  2. Resource preemption

Process Termination

There are two methods to eliminate deadlocks by terminating a process as follows:

  1. Abort all deadlocked processes: This method will break the deadlock cycle clearly by terminating all process. This method is cost effective. And it removes the partial computations completed by the processes.
  2. Abort one process at a time until the deadlock cycle is eliminated: This method terminates one process at a time and invokes a deadlock-detection algorithm to determine whether any processes are still deadlocked.

Resource Preemption

In resource preemption, the operator or system preempts some resources from processes and give these resources to other processes until the deadlock cycle is broken.

If preemption is required to deal with deadlocks, then three issues need to be addressed:

  1. Selecting a victim: The system or operator selects which resources and which processes are to be preempted based on the cost factor.
  2. Rollback: The system or operator must roll back the process to some safe state and restart it from that state.

Starvation: The system or operator should ensure that resources will not always be preempted by the same process?

Related Posts

Leave a Reply

Your email address will not be published.