web analytics

What are the conditions for deadlock situation to occur?

Deadlock

In a system, deadlock situations are moments when processes never finish executing and system resources are tied up, which ultimately prevents other processes from ever starting. Dead lock situations are obviously undesirable, however they occur in systems while the following conditions take place simultaneously. These conditions are not completely independent, that is, all four conditions must hold for a deadlock to occur.

What are the conditions for deadlock situation to occur?

Mutual Exclusion

At least on resource of the system is in non-sharable mode, that is only one process may use it at any given time. Thus if any other process requests for the resource, then that process will have to wait until the current process which is using the resource release it.

Hold and Wait

A process must exist which is already holding a resource and also waiting to grab one or more resources which are currently being held by another processes.

No Preemption

Resources can not be preempted, that is, a resource can be released only by the process that is currently holding it, voluntarily. Thus, release of the process is out of control and a process may hold a resource forever.

Circular Wait

There must exist a set of processes; such as, p0,p1,p2….pN; which are waiting for resources which are in hold by other processes. The process that p0 need is in hold by p1, the process that p1 need is in hold by p2 and so on. It is a dead-end.
Thank you. Take a moment to share 🙏