Deadlock
DEADLOCKS:
The deadlock is a situation, It the resource is not available when it is requested, the requesting process is forced to wait. In some operating system, the process is automatically blocked when a resource request fails and awakened when it becomes available.
A deadlock is situation where groups of process are presently blocked in computer.
Following is Graphical Presentation of A DEADLOCK.
The above figure shows square boxes as resources named R1 and R2. Similarly, processes shown as circles are named P1 and P2. The arrow shows the relationship for example in part (a-1) of the figure, resources R1 is allocated to process p1. or in other words P1 holds R1. In part (b-1) of the figure, process P2 wants resources R2, but it has not got it, it is waiting for it. These graphs are called ‘Directed Resource Allocation Graphs (DRAG)
Now see the following situation for the deadlock.
- P1 holds R1 but demands R2
- P2 holds R2 but demands R1
It we draw the directed resource allocation graph for this situation it will took as shown in following diagram-
An arrow from a process to a resource means that the process is currently blocked waiting for that resource. In figure (b-1), process P2 is waiting for resource R1, which is currently held by process p1. Process p1 is not about to release resource R2 held by P2. Both processes will wait forever. A cycle in the graphs means that there is a deadlock involving the processes .
Comments
Post a Comment