1.

What is a deadlock in Operating Systems? What are the situations for the deadlock to happen?

Answer»

DEADLOCK REFERS to the situation that happens in the operating system where each process will enter into the waiting state for obtaining the resource which has been ASSIGNED to some other process.

Consider a real-time example of traffic that is going only in a single direction. Here, we can consider the bridge as a resource. If one car backs up, the deadlock situation will be RESOLVED easily. Multiple cars may have to be backed up on deadlock OCCURRENCE. So it might lead to starvation.

The process will be considered to be in a deadlock when the following conditions get satisfied simultaneously:

  • Mutual Exclusion: When more than one process shares the same resource and all the processes are different, then each process of them has to wait for the other for utilizing the resource as at a time only one process can use the resource.
  • Hold and Wait: A process is already holding the resource(at least one) and waiting for resources.
  • No pre-emption: We cannot forcefully stop or remove a process among the waiting processes, for releasing the resource.
  • Circular Wait: A group of processes will be waiting in a circular manner for the resources held by each other.


Discussion

No Comment Found