Operating System (2140702)

BE | Semester-4   Winter-2018 | 10-12-2018

Q4) (b)

What is deadlock? Describe in brief necessary conditions that should hold for deadlock to occur.

Deadlock

A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause.

There are four conditions that must hold for deadlock

  1. Mutual exclusion condition
    Each resource is either currently assigned to exactly one process or is available.
  2. Hold and wait condition
    Process currently holding resources granted earlier can request more resources.
  3. No preemption condition
    Previously granted resources cannot be forcibly taken away from process.
  4. Circular wait condition
    There must be a circular chain of 2 or more processes. Each process is waiting for resource that is held by next member of the chain.

All four of these conditions must be present for a deadlock to occur.