In: Computer Science
Given the following state for the Banker’s Algorithm.
6 processes P0 through P5
4 resource types: A (15 instances); B (6 instances)
C (9 instances); D (10 instances)
Snapshot at time T0:
a. Verify that the Available array has been calculated correctly.
b. Calculate the Need matrix.
c. Show that the current state is safe, that is, show a safe sequence of processes. In addition, to the sequence show how the Available (working array) changes as each process terminates.
d. Given the request (3, 2, 3, 3) from Process P5. Should this request be granted? Why or why not?
a.
15 – (2+0+4+1+1+1) = 6
6 – (0+1+1+0+1+0) = 3
9 - (2+1+0+0+0+1) = 5
10 – (1+1+2+1+0+1) = 4
b.
Need Matrix = Max Matrix – Allocation Matrix
c.
The following matrix shows the order in which the processes and shows what is available once the give process finishes)
d.
ANSWER is NO for the following reasons: IF this request were granted, then the new allocation matrix would be:
Then the new need matrix would be
And Available is then:
Which means we could NOT satisfy ANY process’ need.
Which means we could NOT satisfy ANY process’ need.