1.

What do you understand about deadlocks in the context of Operating Systems? What are the necessary conditions for deadlock to occur in a system?

Answer»

When a process enters a WAITING state because another waiting process is holding the requested resource, it is referred to as a deadlock. A typical difficulty in multi-processing is a deadlock, which occurs when numerous processes share a mutually exclusive resource known as a soft lock or software.

The FOLLOWING are the necessary conditions for a deadlock to occur in a system:

  • No preemption - A resource can only be released FREELY by the process that is holding it once it has completed its task.
  • Mutual Exclusion - The resource should not be shareable. If the resource is being used by a process, it cannot be used by another process until the current process RELEASES it.
  • Hold and wait - Suppose that a process holds onto some of the resources required for its execution. However, some of the resources that it requires are being held by other resources. Deadlock can happen only when this process does not give away its acquired resources and keeps on waiting for the other resources.
  • Circular Wait - Two or more processes waiting for each other to complete their task and release the resources should form a CYCLIC dependency graph. It is only then that no process would be able to complete its execution and a deadlock would be obtained.


Discussion

No Comment Found