The total amount of available resources before any program runs is A: 2, B: 12,
ID: 3825649 • Letter: T
Question
The total amount of available resources before any program runs is A: 2, B: 12, C: 9
Allocation
A B C
P0 0 0 1
P1 0 0 0
P2 1 3 3
P3 0 4 3
Max
A B C
P0 0 0 1
P1 1 7 5
P2 2 3 5
P3 2 9 9
Answer the following questions using the banker’s algorithm:
(Must show work for credit!!)
1. Is the state of the system safe or unsafe? Explain or show a safe sequence.
2. Could a request of p1 for the additional resources of (0, 5, 2) be granted and still maintain the system in a safe state? Explain or show a safe sequence.
3. What is the state of the system if a request of p3 for (0, 5, 1) is granted instead? Explain or show a safe sequence.
Explanation / Answer
P0 executes as Need <Available , Available = Available + Allocation = [2 12 10]
P1 executes as Need <Available , Available = Available + Allocation = [2 12 10]
P2 executes as Need <Available , Available = Available + Allocation = [3 15 13]
P3 executes as Need <Available , Available = Available + Allocation = [3 19 16]
So system is in safe state and safe sequence is <P0,P1,P2,P3>
2.
Need of P1 = [1 12 7] now and avaiable is [2 12 10] so it can be executed safely as Need <Available. the safe sequence will be the same<P0,P1,P2,P3>
3.
Need of P3 = [0 5 3] can be easily fulfilled by Avaialble as Available > Need. The safe sequence is same P0,P1,P2,P3>
Process ALLOCATION MAX NEED = MAX-ALLOCATION A B C A B C A B C A B C 2 12 9 P0 0 0 1 0 0 1 0 0 0 P1 0 0 0 1 7 5 1 7 5 P2 1 3 3 2 3 5 1 0 2 P3 0 4 3 2 9 9 2 5 6Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.