KEMBAR78
07 lcd slides 1 - DEADLOCKS POWERPOINT | PPSX
Deadlocks
 Introduction to Deadlocks
 Deadlock Prevention
*Property of STI J0024
Deadlock
 condition wherein a set of processes cannot continue executing because each
process is waiting for a resource that is being held or used by another process
within the set
P1 is
requesting to
use R2
Resource
R1
Process
P1
Resource
R2
Process
P2
P2 is currently
using R2
P1 is currently
using R1
P2 is
requesting to
use R1
Figure 7.1 Example of a Deadlock
*Property of STI J0024
P2 is waiting for
a resource
being held by P1
Process
P1
Process
P2
P1 is waiting for
a resource
being held by P2
Figure 7.2 Example of a Deadlock Using a Wait-For Graph
*Property of STI J0024
Figure 7.3 Traffic Deadlock
*Property of STI J0024
Necessary conditions for a deadlock:
 Mutual exclusion
 Hold and wait
 No preemption
 Circular wait
*Property of STI J0024
Deadlocks can be prevented by removing at least one of the four
conditions:
 Removing the mutual exclusion condition
 Removing the hold and wait condition
 Removing the no preemption condition
 Removing the circular wait condition

07 lcd slides 1 - DEADLOCKS POWERPOINT

  • 1.
    Deadlocks  Introduction toDeadlocks  Deadlock Prevention
  • 2.
    *Property of STIJ0024 Deadlock  condition wherein a set of processes cannot continue executing because each process is waiting for a resource that is being held or used by another process within the set P1 is requesting to use R2 Resource R1 Process P1 Resource R2 Process P2 P2 is currently using R2 P1 is currently using R1 P2 is requesting to use R1 Figure 7.1 Example of a Deadlock
  • 3.
    *Property of STIJ0024 P2 is waiting for a resource being held by P1 Process P1 Process P2 P1 is waiting for a resource being held by P2 Figure 7.2 Example of a Deadlock Using a Wait-For Graph
  • 4.
    *Property of STIJ0024 Figure 7.3 Traffic Deadlock
  • 5.
    *Property of STIJ0024 Necessary conditions for a deadlock:  Mutual exclusion  Hold and wait  No preemption  Circular wait
  • 6.
    *Property of STIJ0024 Deadlocks can be prevented by removing at least one of the four conditions:  Removing the mutual exclusion condition  Removing the hold and wait condition  Removing the no preemption condition  Removing the circular wait condition