Deadlock

1. Processes compete for physical and logical resources in the system.
2. A process requests a resources.
3. If the resources are not available at that time, a process enters into the wait state.
4. It may happen that waiting processes will never change the state again, because the resources requested by the process are occupied by some other process.
5. And this situation leads to Deadlock.
6. Deadlocks affects the progress of processes by causing indefinite delays in resource allocation.
7. Deadlocks are a set of blocked processes each holding a resource and waiting to acquire a resource held by another process.

Image: 

Image result for deadlock image

Contributor's Info

Created:
0Comment
Deadlock

In multiprogramming system, when a waiting process is never able to get resources to complete its execution because the resources it has requested are held by another waiting process. This situation is called deadlock. This process can not proceed because of cyclic waiting of resources.

 

Resource Allocation Graph (RAG):

Resource allocation graph (RAG) is used for recognize deadlock situation in the system. RAG is directed graph which consist of set of vertices that represents processes (P = {P1, P2, … , Pn}), also resources (R = {R1, R2, … , Rn}) and set of directed edges that represents resources requests (P1 → R1, P2 → R3) and allocations in the system (R2 → P1, R1 → P1, R3 → P4).

Each process utilizes a resource using request, use and release. Each resource type Ri has Wi instances.

When a process request a resource; it is made through a system call. If resource is not available or it held by another process, then process must have to wait for resource. A process releases the resources through system call. Process can use a resource if it is available to use.

 

Processes always represented with circles and resources represented with rectangles in RAG as following:

 

        44.jpg

 

RAG when a process request a resource:

 

         45.jpg

 

RAG when an instance of a resource allocated to a process:

 

  47.jpg

Contributor's Info

Created:
0Comment