0
6.3kviews
Consider the following snapshot of a system:

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. • Available = (4, 2, 5, 3) • Available = (1, 5, 0, 2)

enter image description here

1 Answer
1
341views

Banker's Algorithm

First Calculate the Need Matrix

Need [i] = Max [i] - Allocation [I]

Need for P0: (4, 3, 2, 6) – (1, 2, 0, 2) = (3, 1, 2, 4)

Need for P1: (2, 4, 1, 4) – (0, 1, 1, 2) = (2, 3, 0, 2)

Need …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.