If a necessary conditions for a deadlock to occur are in free place, it is still possible to avoid deadlock by being careful when resources are allocated, perhaps the most famous deadlock avoidance algorithm is Dijkstra’s bankers algorithm, called by this interesting name because it involves a banker who makes loans and receives payment from a given sources of capital.
Dijkstra’s algorithm is used for deadlock avoidance. The statement and assumption of bankers’s algorithm are given below:
The assumption for (Dijkstra’s )banker’s algorithm is as follows:
- Every process tells in advance, the number of resources of each type it may require.
- No process asks for more resources than what the system has.
- At the termination time every process will release resources.
Statement: Resources for a process are allocated so that transition is always from a safe state to another state.
According to this Dijkstra’s (banker’s) algorithm when a new process enters the system, it must declare the maximum number of instances of each resource type that it may need.
This number may not exceed the total number of resources in the system. When a user requests a set of resources, the system must determine whether the allocation of these resources will leave the system in a safe state.
if it will, the resources are allocated, otherwise the process must wait until some processes release enough resources.
In the case of any queries, you can write to us at email@example.com we will get back to you ASAP.
Hope! you would have enjoyed this post about Dijkstra’s banker’s algorithm for deadlock avoidance.
Please feel free to give your important feedbacks in the comment section below.
Have a great time! Sayonara!