Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A system has three resource types (A, B, C) and four processes {P1, P2, P3, P4 }

ID: 3677703 • 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.

PROCESS ALLOCATION A B C PO C*PO is just an example) P1 1 1 P2 2 2 0 P3 3 0 1 P4 1 1 MAX A B C 1 3 6 2 3 3 2 1 6 5 4 4 4 2 NEED A B C 3 2 6

Explanation / Answer

Need = maximum resources - currently allocated resources
Pro0cesses (possibly needed resources):
  
Process Allocation Max Need Total Available
   A B C A B C A B C A B C
P1   0 1 2 1 2 3 1 1 1   8 5 4
P2   1 0 1 3 2 1 2 2 0 8 5 4
P3   3 5 3 6 5 4 3 0 1 8 5 4      
p4   3 4 1 4 4 2 1 0 1 8 5 4      

Available(Ex.2)
A B C
1 0 0
not in safe state <1 0 0> + <3 2 1> - <2 2 0>

Available(Ex.1)
A B C
3 2 2
5 3 4
6 3 5
9 8 8
Lets take Example of available resource as <1 0 0> for A B C .
In this case its not in safe state as P1 cant get enough resources.
If the processes cant return the same amount of total resources <8 5 4> then also its not in safe state.
consider the case of initial available resources <3 2 2>.
P1 acquires 1 A, 1 B and 1 C more resources, achieving its maximum
[available resource: <3 2 2> - <1 1 1> = <2 1 1>]
The system now still has 2 A, 1 B and 1 C resources available
P1 terminates, returning 3 A, 2 B, 3 C resources to the system
[available resource: <2 1 1> + <3 2 3> = <5 3 4>]
The system now has 5 A, 3 B and 4 C resources available
P2 acquires 2 A and 2 B extra resources, then terminates, returning all its resources
[available resource: <5 3 4> - <2 2 0> + <3 2 1> = <6 3 5>]
The system now has 6 A, 3 B, 5 C resources
P3 acquires 3 A and C resources and terminates
[available resource: <6 3 5> - <3 0 1> + <6 5 4> = <9 8 8>]          
(Here, it has the capability of returning resources...and also in any step available resources are not
less than max-need)      
The system now has 9 A, 8 B, 8 C resources.
P4 acquires 1 A, 1C extra resources, then terminates, returning all its resources.
[available resources: <9 8 8> - <1 0 1> + <4 4 2> = <12 12 10>
Because all processes were able to terminate, this state is safe.
If available resource cannot meet the demands of the process need it in unsafe state.
So is the case of <1 0 0> example

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote