Professional Documents
Culture Documents
Ch8 - Deadlocks
Ch8 - Deadlocks
first_mutex = 1
second_mutex = 5
Need A B C
ABC Work = 3 3 2
Chọn P1 5 3 2
P0 743
Chọn P3 7 4 3
P1 122 Chọn P4 7 4 5
Chọn P2 10 4 7
P2 600
Chọn P0 10 5 7
P3 011
P4 431
The system is in a safe state since the sequence < P1, P3,
P4, P2, P0> satisfies safety criteria
Detection algorithm
Recovery scheme
Resource-Allocation Graph
Corresponding wait-for graph
Sequence <P0, P2, P3, P1, P4> will result in Finish[i] = true for
all i
State of system?
Can reclaim resources held by process P0, but
insufficient resources to fulfill other processes; requests
Deadlock exists, consisting of processes P1, P2, P3, and
P4