Describe the Deadlock characteristics for different resource system.

Describe the Deadlock characteristics for different resource system.


In Multiprogramming, a process is said to enter into a waiting state if the resources requested are not available at that instance. A situation may arise where in processes continue to be in waiting state as they are held by waiting processes. This is deadlock.
In other words, deadlock is an unwanted situation that arises when multiple processors are made to wait for a particular resource which is not currently available as being held up by another process in the wait state.
The simultaneous occurrence of the following four necessary condition results in a deadlock:
1. Mutual exclusion condition: Only one process at a time is permitted to use the resource.
2. Hold and wait condition: There is at least once process already holding resources that can request new resource held by other processes.
3. No preemption condition: Resources can be released normally by the process holding it after it completes execution. No resource can be forcibly removed from a process holding it.
4. Circular wait condition: There exists a set {P0,P1,P2,…,Pn} of process waiting such that
a. P0 is waiting for a resource that is held by the process P1
b. P1 is waiting for a resource held by the process P2 and so on.
c. Pn is waiting for a resource held by P0.
In a deadlock-free situation, a process requests for resource or set of resources, use them and release all or some of them. Operations like request and release device, open and close a file and allocate free memory are done by system calls. Request and release operations for other resources are made by wait and signal calls.
Deadlocking can be prevented by preempting resources from some processes. We preempt some resources from processes and allocate them to other processes till the deadlock cycle is cleared. One should follow an integrated approach to deadlock handling.
Partition the resources into different disjoint resource classes, e.g., the partitioned classes can be: resource classes that are used in swapping...

Similar Essays