Professional Documents
Culture Documents
Operating Systems
Sheet 7
Deadlock and Starvation
Process P Process Q
Get A Get B
Get B Get A
Release A Release B
Release B Release A
Process P Process Q
Get A Get B
Release A Get A
Get B Release B
Release B Release A
GENERAL QUESTIONS
10.
a.
Process R1 R2 R3 R4
P1 0 0 0 0
P2 0 7 5 0
P3 6 6 2 2
P4 2 0 0 2
P5 0 3 2 0
b. the system is safe after applying banker’s algorithm as there
is no process waiting for resources.
Start with (2,1,0,0)
Gets P1 -> (2,1,1,2)
Gets P4 -> (4,4,6,6)
Gets P5 -> (4,6,9,8)
Gets P2 -> (6,6,9,8)
Gets P3 -> Done.
c. same as the last one no deadlocks using deadlock detection
algorithm.
d. none
e. it can be granted immediately but can cause deadlock at
process P3 and P2.