A system has three resource types (A, B, C) and four processes {P1, P2, P3, P4 }
ID: 3677563 • Letter: A
Question
A system has three resource types (A, B, C) and four processes {P1, P2, P3, P4 }. The total units of system resources are: (8, 5, 4) units of A, B and C, respectively. The maximum demands for each process is P1(1,2,3), P2(3,2,1), P3(6,5,4) and P4(4,4,2). The current allocation is: P1(0,1,1), P2(2,2,0) and P3(3,0,1) and P4(1,0,1).
(a) Allocation table is given for the 3 processes with the following four columns: PROCESS, ALLOCATION, MAX and NEED. And fill this table with the current allocation state.
(b) Is this state a safe state? Explain your answer by identifying a successful future sequence of processes that makes the state safe, or by explaining which processes are part of the problem that makes the state unsafe?
PROCESS ALLOCATION MAX NEED
A B C A B C A B C
* P0 4 5 0 1 3 6 3 2 6 (*P0 is just an example)
P1 0 1 1 1 2 3
P2 2 2 0 3 2 1
P3 3 0 1 6 5 4
P4 1 0 1 4 4 2
Explanation / Answer
A)
B) No this state is not safe, because total resources required is (8,10,7) but the total available units are (8,5,4) thus it may go for a race conditions for resources B and c. P3 makes this state unsafe because P3 itself is using 5 units of the whole available B resource. One of the successful sequence is exectues P1,P2,P4 in parallel then after release execute p3
PROCESS ALLOCATION MAX NEED P1 0 1 1 1 2 3 1 1 2 P2 2 2 0 3 2 1 1 0 1 P3 3 0 1 6 5 4 3 5 3 P4 1 0 1 4 4 2 3 4 1Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.