Suppose there are 5 processes P0, P1, P2, P3, P4 and 4 kinds of resources A, B, C, D in…
- User
Suppose there are 5 processes P0, P1, P2, P3, P4 and 4 kinds of resources A, B, C, D in the system, if the following resource allocation occurs:
Process Allocated Resources Need Resources Available Resources P0 (1,1,1,0) (0,3,3,1) (0,3,2,2) P1 (0,2,3,1) (0,3,4,2)
P2 (0,2,1,2) (1,0,3,4) P3 (0,3,1,0) (0,3,2,0)
P4 (1,0,2,1) (0,4,2,3)
Is this state safe? Why? Answer: Process Work Need Allocation Work + Allocation Finish P3 0,3,2,2 0,3,2,0 0,3,1,0 0,6,3,2 True P0 0,6,3,2 0,3,3,1 1,1,1,0 1,7,4,2 True P1 1,7,4,2 0,3,4,2 0,2,3,1 1,9,7,3 True P4 1,9,7,3 0,4,2,3 1,0,2,1 2,9,9,4 True P2 2,9,9,4 1,0,3,4 0,2,1,2 2,11,10,6 True There is a safe sequence P3, P0, P1, P4, P2, so this state is safeAbove is example question and answer, please explain how to find the work, safe sequence and how to know this is safe state or not
- Assistant