Mimi R.

asked • 12/05/21

Banker’s algorith


Allocation. MAX

R1 R2 R3 R4. R1 R2 R3 R4

T1. 3. 0. 1. 4. 3. 1. 1. 7

T2. 2. 2. 1. 0. 3. 2. 1. 1

T3. 3. 1. 2 1. 3 3. 2. 1

T4. 0. 5. 1. 0. 4. 6 1. 2

T5. 4. 2. 1. 2. 6. 3. 2. 5

Using the banker's algorithm, determine whether or not each of the following states is unsafe. If the state is safe, illustrate the order in which the threads may complete. Otherwise, illustrate why the state is unsafe. Show details for either scenario. (a) Available = (0, 3, 0, 1)

(b) Available = (1, 0, 0, 2)


For A others say that it’s unsafe because it doesn’t work for T1 and T5but it works for me. So could you explain why it won’t work.

to solve this question I get the need first getting R1 R2 R3 R4
T1  2   1    0    3
T2  1   0    0    1
T3  0   2    0    0
T4  4   1    0    2
T5  2   1    1    3


then I check using T1<= 0,3,0,1 which is false but is true for T3 which is (3,4,2,2) the rest are false then I check T1 with the new available which is true no?


Daniel B.

tutor
I do not quite follow your notation, but I agree with you. When starting from state where (0,3,01) is available I can run the processes to completion in the order T3, T2, T4, T5, T1
Report

12/07/21

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.