1.

What do you understand about deadlocks in the context of Operating Systems? What are the four necessary conditions for deadlock to happen?

Answer»

A deadlock occurs when a GROUP of processes is stalled because each process is holding a resource and waiting for another process to obtain it. Consider the situation when two cars are approaching each other on a narrow bridge and there is only ONE way: once they are in front of each other, neither of the two cars can move. In OPERATING systems, a similar situation happens when two or more processes hold some resources while waiting on resources owned by other processes (s). 

The following are the four necessary conditions for deadlock to take place:

  • Mutual Exclusion: One or more resources are not available for sharing (Only one process can use at a time)
  • Hold and Wait: A process is holding at least one resource and waiting for further resources.
  • No Preemption: A resource can only be OBTAINED from a process if it is released by the process.
  • Circular Wait: A COLLECTION of operations is waiting for each other in a circular fashion.


Discussion

No Comment Found