Banker s algorithm

The banker's algorithm is used to avoid deadlocks. To use it, you have to think like a bank. Basically, you have to put each state into a separate queue. You then use four arrays: available, allocation, maxim, and need. In terms of little O notation, the banker's algorithm is o(n2m), where n is the processes and m is the resources.

Working of Banker's Algorithm:

Four arrays are used to store the following information in them:

  1. Available [m]: This array stores the total number of resources, available or allotted both.
  2. Allocation [m \times n]: or Current Allocation. This array stores the current allocation to the processes.
  3. Maximum Allocation [m \times n]: This array stores the maximum allocation of each process.
  4. Need Allocation [m \times n]: This array is calculated on the basis of the matrix subtraction of Maximum Allocation with Current Allocation.



See also Banker's rounding


de:Bankier-Algorithmus

This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information.