Professional Documents
Culture Documents
2019 20 OS MID Paper
2019 20 OS MID Paper
OR
A Write an algorithm and Explain in detail The Peterson’s solution for Mutual 5 L2
Exclusion in Producer Consumer problem.
Page 1 of 2 P.T.O
B At an instant the recourse allocation state in the system is as follows: 6 L3
4 processes p1 to p4.
4 resources R1(6 instance) R2(4 instance) R3(3 instance) R4(3 instance)
Allocation Request
R1 R2 R3 R4 R1 R2 R3 R4
P1 1 1 0 0 5 1 3 2
P2 2 1 1 1 2 1 0 2
P3 0 0 2 1 2 0 0 1
P4 1 1 0 0 5 2 3 3
Using Bankers Algorithm find out the safe sequence to avoid deadlock.
D Explain Test and Set Lock for mutual exclusion using example. 2 L2
***************
Page 2 of 2