ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > 2017329621029 方一凡 >
Homework-5 Version 0
👤 Author: by 390645143qqcom 2019-11-28 03:44:43
describe your understadings about Banker's Algorithm, and give your own demo example.

What's banker's algorithm?

Banker's algorithm is an algorithm to avoid deadlock.Banker's algorithm has four attributes:available,max,allocation,need.

The operating system allocates resources to the process according to the rules formulated by the banker. When the process first applies for resources, it needs to test the maximum demand for the process. If the system's existing resources can meet its maximum demand, it is allocated according to the current application Resources, otherwise delay the allocation. When the process continues to apply for resources during execution, first test whether the number of resources requested by the process this time exceeds the total amount of resources remaining. If it exceeds, it will refuse to allocate resources, if it can meet, it will allocate resources according to the current application amount, otherwise it will postpone the allocation.

DEMO:

A    B    C

volume dose: 11    7    9

allocation            max          available

A  B  C             A  B  C         A  B  C

P0             1   0   0            2   1   0        2   0   3

P1              3   4   1            3   6   6

P2              2   1   0            2   1   0

P3              0   1   4            9   5   4

P4              3   1   1            6   2   5

So the available scheme is : P0-P1-P2-P4-P3

Please login to reply. Login

Reversion History

Loading...
No reversions found.