Skip to content
TimL03 edited this page Aug 26, 2023 · 3 revisions

Bankier Algorithm:

Request:

When the process has requested to find the next resource it will first select the next resource it wants to reserve along with the amount.

Checking for save state:

When the next resource has been selected the banker's algorithm will check if the state resulting from the reservation of that resource will be save or not through these three steps:

1. Step

In the requirements matrix search for a row with values smaller or equal to the currently free resources array. If there is none the state isn't save and the resources won't be reserved.

2. Step

If a matching row is found it will be marked as finished and the resource counts are added to the currently free resources array.

3. Step

Repeat the steps 1 and 2 until all processes are marked as finished. If all are smaller or equal the current state is save, otherwise, it's a possible deadlock and won't be reserved.

Reservation:

If the algorithm marks the current state as save, the process will acquire the resources needed by the requesting process.

Clone this wiki locally