In: Other
Consider the following snapshot of a system:
Allocation Max Available
ABCD ABCD ABCD
T0 3141 6473 2224
T1 2102 4232
T2 2413 2533
T3 4110 6332
T4 2221 5675
Answer the following questions using the banker’s algorithm:
a. Illustrate that the system is in a safe state by demonstrating an order in which the threads may complete.
b. If a request from thread T4 arrives for (2, 2, 2, 4), can the request be granted immediately?
c. If a request from thread T2 arrives for (0, 1, 1, 0), can the request be granted immediately?
d. If a request from thread T3 arrives for (2, 2, 1, 2), can the request be granted immediately?
a) safe succession : T2, T0, T1, T3, T4
b) T4 arrive (2, 2, 2, 4) when T4 allocate available resource 7 7 7 8 + 2 1 0 2 + 4 1 1 0 = 13 9 9 10
which can fullfill the need + request = 5 6 7 5 + 2 2 2 4 = 7 8 9 9 So request granted.
c) let allocate resource to T3, after sometime available resource = 2 2 2 4 + 4 1 1 0 = 6 3 3 4 which can fullfill the need of T2 so granted only after T3.
d) When resource allocated to T3 available resource= 4 6 3 7
Which can fullfill the need and request of T3 So request granted.