i) Determine the total amount of resources of each type?
total amount of resources of each type A , B & C is 6 , 12 & 9 respectively.
ii)What is the content of matrix needed?
iii)Determine the system in safe state using safety algorithm?
Need for process P0 is (3,2,1) and available (2,1,0)
Need < = available => False
Move to the next process
Need for process P1 is (1,1,0) and available (2,1,0)
Need < = available => True
The request for P1 is granted and process will be release resources.
Work = Available + Allocation
= (2,1,0) + (2,1,2)
= (4,2,2)
Need for process P2 is (4,2,2) and available (4,2,2)
Need < = available => True
The request for P2 is granted and process will be release resources.
Work = Available + Allocation
= (4,2,2) + (0,2,0)
= (4,6,2)
Need for process P3 is (2,0,0) and available (4,6,2)
Need < = available => True
The request for P3 is granted and process will be release resources.
Work = Available + Allocation
= (4,6,2) + (0,6,3)
= (4,12,5)
Need for process P4 is (1,1,1) and available (4,12,5)
Need < = available => True
The request for P4 is granted and process will be release resources.
Work = Available + Allocation
= (4,12,5) + (1,1,2)
= (5,13,7)
6.Need for process P0 is (3,2,1) and available (5,13,7)
Need < = available => True
The request for P0 is granted and process will be release resources.
Work = Available + Allocation
= (5,13,7) + (1,1,2)
= (6,14,9)
Safe Sequence is (P1, P2, P3, P4, P0)
iv)If a request for p1 arrives for (1,1,0) can the request be granted immediately?
Yes if P1 arrives for (1,1,0) the request can be granted immediately.as available resources are 2,1,0
Need for process P0 is (3,2,1) and available (2,1,0)
Need < = available => False
Move to the next process
Need for process P1 is (1,1,0) and available (2,1,0)
Need < = available => True
The request for P1 is granted and process will be release resources.
Work = Available + Allocation
= (2,1,0) + (2,1,2)
= (4,2,2)