Banker’s Algorithm (Dijkstra and Habermann)

Banker’s Algorithm (Dijkstra and Habermann):It is a deadlock avoidance algorithm.

The following data structures are used in the algorithm:m = number of resourcesn = number of processes

Available [m] : One dimensional array of size m. It indicates the number of available resources of each type. For example, if Available [i] is k, there are k instances of resource ri.

Max [n,m] : Two dimensional array of size n*m. It defines the maximum demand of each process from each resource type. For example, if Max [i,j] is k, process pi may request at most k instances of resource type rj.

Allocation [n,m] : Two dimensional array of size n*m. It defines the number of resources of each type currently allocated to each process.

Check whether the resulting state is safe. (Use the safety algorithm presented below.)

If the state is safe, do the allocation. Otherwise, pi must wait for Request(i).

Safety Algorithm to perform Step 5:
Let Work and Finish be vectors of length m and n, respectively.
1. Initialize Work = Available, Finish [j] = false, for all j.
2. Find an i such that Finish [ i ] = false and Need(i) ≤ Work If no such i is found, go to step 4.
3. If an i is found, then for that i, do :
Work = Work + Allocation(i)
Finish [i] = true
Go to step 2.
4. If Finish [j] = true for all j, then the system is in a safe state.

ABOUT US - Team Behind This Plateform

We Are Engineering Graduate ,Tutor and Technology lover, Our Primary Main Area of interest is Computer Science And Electronics & Communication Technology

We are trying to make all those topics more simple and easy to understand,So that it will help students to learn it very quickly in limited amount of time like Last Peak hours of their Extermination,its like last time revision Notes. we also have provided the depth knowledge of some topics which really require more words to explain.

Other Area of this online platform contains "Online MCQ based Tests / Multiple choice Questions" ,Which can Helps readers to crack Various competitive Exams

Computer subject become necessary for all the students from various branches, and this plateform will provide them all the required knowledge to answer the Questions correctly in the various competative exams