Deadlock detection and recovery occurs after system into deadlock situation. Resource allocation graph (RAG) is used as deadlock detection algorithm.

• For single instance type resources when a cycle exists in the resource allocation graph then deadlock situation occurred otherwise no deadlock.

• For multiple instances type resources when a cycle exists in the resource allocation graph then deadlock may occurred, then Banker's algorithm to check that deadlock is occurred or not. If there is no cycle exists in the resources allocation graph (RAG), then is no deadlock in the system.

• If all the resource are of single instance type then the cycle in the RAG is necessary and sufficient  condition for occuring a deadlock

• If the resource are of not single instance type then cycle in RAG is just a necessary condition but not a sufficient condition for occuring of deadlock

##### Characteristics for Deadlock | Mutual Exclusion | No Preemption | Hold and Wait | Circular Wait

There are four conditions that must be present simultaneously for a deadlock to occur:

Mutual Exclusion

The mutual exclusion condition must hold for non-shareable resources that is only one process can use a resource at a time. If another process want to access that resource, then it must wait until the resource has been released.

No Preemption

There be no preemption of resources that have already been allocated that means no process is allowed to preempt another process forcibly in order to gain a release of a resource from it. So, we should check before resource allocation if it has already allocated to another process.

Hold and Wait

When a process is already holds a resource and while for additional resource that are currently being held by other processes.This situation is known as hold and wait.

Circular Wait

Processes waiting for resources from the others form a circular chain, that means all waiting processes form a circular chain or circular list where each process in the list is waiting for a resource held by next process in the list.

​

##### Characteristics for Deadlock| Mutual Exclusion | No Preemption | Hold and Wait | Circular Wait

There are four conditions that must be present simultaneously for a deadlock to occur:

Mutual Exclusion

The mutual exclusion condition must hold for non-shareable resources that is only one process can use a resource at a time. If another process want to access that resource, then it must wait until the resource has been released.

No Preemption

There be no preemption of resources that have already been allocated that means no process is allowed to preempt another process forcibly in order to gain a release of a resource from it. So, we should check before resource allocation if it has already allocated to another process.

Hold and Wait

When a process is already holds a resource and while for additional resource that are currently being held by other processes.This situation is known as hold and wait.

Circular Wait

Processes waiting for resources from the others form a circular chain, that means all waiting processes form a circular chain or circular list where each process in the list is waiting for a resource held by next process in the list.

​