I am not able to figure out how two conditions for deadlock are different from each other. Hold and wait is look like a subset of the circular wait.
– The hold andwait condition can be prevented by requiring that a process request all its required resources at one time, and blocking the process until all requests can be granted simultaneously.
Hold and Wait - A process must be simultaneously holding at least one resource and waiting for at least one resource that is currently being held by some other process.
Circular wait: each process must be waiting for a resource which is being held by another process, which in turn is waiting for the first process to release the resource.
Mutual Exclusion: Only one process can use a resource at any given time i.e. the resources are non-sharable. Hold and wait: A process is holding at least one resource at a time and is waiting to acquire other resources held by some other process.
Hold and Wait and Circular Wait are conditions that are met when deadlocks occur.
This means that if these two conditions are not met, you will not be in a deadlock.
The hold and wait condition states that the process is holding onto a resource/s that may (or may not) be required by other processes. The key point here is that the process is holding onto those resources and will not release them until it gets access to the requested resources (which are being held by other processes).
The circular wait condition states that there exists a chain of processes where each process is waiting for a resource that is being held by another process. In this condition it does not necessarily mean that the process is holding onto a resource that the other is requesting, but rather that all processes are waiting for a resource that is being held by another process.
See these articles for more information:
http://www.cs.yale.edu/homes/aspnes/pinewiki/Deadlock.html http://nob.cs.ucdavis.edu/classes/ecs150-1999-02/dl-cond.html
For Hold And Wait, There must exist a process that is holding a resource already allocated to it while waiting for additional resource that are currently being held by other processes. Whereas, for Circular Wait to occur The processes in the system form a circular list or chain where each process in the list is waiting for a resource held by the next process in the list.
Point to be noted: the formation of chain (Circular list) is must for Circular Wait which is not the case with Hold and Wait.
Reference: http://www.personal.kent.edu/~rmuhamma/OpSystems/Myos/deadlockCondition.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With