Question: QUESTION 1 (20 marks) a) Discuss two hardware approaches to supporting mutual exclusion. (4 marks) b) A system comprises three processes [P1 P2 P3] and

QUESTION 1 (20 marks) a) Discuss two hardware approaches to supporting mutual exclusion. (4 marks) b) A system comprises three processes [P1 P2 P3] and five resources [R1 R2 R3 R4 R5]. Snapshot at the initial time stage is shown in Fig. 1(b). R1 R2 R3 R4 R5 6 24 23 R1 R2 R3 R4 R5 P13 2 0 | 22 . P22 21 00 P3 2 1 3 2 2 R1 R2 R3 R4 R5 P1 | 2 | 10 | 11 21 P2 2 0 0 0 0 20 P3 1 0 2 1 2 10 21 | 0 0 Resource vector R Claim matrix C Allocation matrix A Fig. 1(b). Deadlock Prevention using Banker's Algorithm i. Sketch resource allocation graph of the system. (2 marks) ii. Calculate the Available Vector (V) and Need Matrix. (2 marks) iii. Use banker's algorithm to predict whether the current allocation state is safe. If so, give at least one safe sequence of the process. Besides, show how the Available Vector (V) changes as each process terminates. (4 marks) iv. If the request [4101 1] from Pl arrives, evaluate will it be correct to grant the request? Justify your decision. (2 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
