deadlockhandlingmethods

Methods For Deadlock Handling

There are three methods for deadlock handling:

  1. Ensuring that deadlock state will never occur – To make sure this condition there are two techniques used which is explained below:

Deadlock prevention:

In this scheme, deadlock is prevented by ensuring that at least one condition occurs out of four conditions (mutual exclusion, hold and wait, no preemption, circular wait) required for occurring deadlock state.

Deadlock avoidance:

This scheme requires additional information about how resources will be requested by a process in its lifetime. By this information, it takes a decision whether a resource should be allocated to the processor it should wait.
Here, all available resources are allocated currently and resources will be requested in the future are kept in the account.

2. After occuring deadlock:

In this system we allow the system to enter a deadlock state, detect it, and recover. In this enviroment the system can provide an algorithm that examine the state of the system to determine whether a deadlock has occurred, and an algorithm to recover from the deadlock.

3. Some system does not ensure that a deadlock will never occur.

And also does not provide a mechanism for deadlock detection and recovery, then we may arrive at a situation where the system is in deadlock state yet has no way of recognizing what has happened.


This method is not viable, approach to the deadlock problem, however, in many system deadlock occur infrequently, once per year, thus this method is cheaper than the costly deadlock prevention, deadlock-avoidance, or deadlock detection and recovery methods that must be used constantly. Also, in some circumstances the system is in a frozen state but not in a deadlock state.

In the case of any queries, you can write to us at a5theorys@gmail.com we will get back to you ASAP.

Hope! you would have enjoyed this post about deadlock handling.

Please feel free to give your important feedbacks in the comment section below.

Have a great time! Sayonara!