ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > >
Homework-5 Version 0
👤 Author: by ikarososohucom 2019-10-11 11:51:19
Describe your understadings about Banker's Algorithm, and give your own demo example.

The Banker's algorithm is a kind of deadlock avoidence algorithm, which is used to see if there is a possibility that deadlock happens. If the possibility exists, no resource will be aranged to the process, in order to avoid the deadlock.

The basic theory of Banker's algorithm is described here.

1. Get the current number of  availiavle instances of resources and use a matrix called 'Avaliable' to store it.

2. Exam all the existing process, record their maximum number of instances nedded and number of alreay allocated instances.  Also, store there information in the matrix 'Max' and 'Allocation'.

3. Use 'Max' - 'Allocation' to calculate the matrix 'Need', so that we can see if we can satisfy a specific process with our availiable instances.

4. We try to find a 'safety sequence'  where all the process can be finished without deadlock. If the sequence exists, it is safe. If not, it is not safe and deadlock will happen.

As far as I am concerned, this algorithm is useful and realiable, but it seems that the algorithm cost a lot of time and is not so efficient. The worst case is that we have to go thourh all the possible combinations of the process and we find the good sequence in the last combination. The time complexicity can be really high, which is O(n^2).

 

Please login to reply. Login

Reversion History

Loading...
No reversions found.