Lecture_5
Lecture_5
M. Morsedur Rahman
Lecturer
Department of CSE,DIU
System Model
Deadlock Characterization
Resource-Allocation Graph
2. Hold and wait. A process must be holding at least one resource and waiting
to acquire additional resources that are currently being held by other
processes.
4. Circular wait. A set {P0, P1, ..., Pn} of waiting processes must exist such
that P0 is waiting for a resource held by P1, P1 is waiting for a resource held
by P2, ..., Pn−1 is waiting for a resource held by Pn, and Pn is waiting for a
resource held by P0.
We emphasize that all four conditions must hold for a deadlock to occur.
• However, there is no deadlock. Observe that process P4 may release its instance
of resource type R2. That resource can then be allocated to P3, breaking the cycle.
No Circular
preemption wait
No Circular
preemption wait
• At time t0, the system is in a safe state. The sequence <P1, P0, P2> satisfies the
safety condition.
• The sequence <P1, P3, P4, P2, P0> satisfies the safety criteria.