Skip to content

🚦 Dijkstra's famous algorithm

License

Notifications You must be signed in to change notification settings

iguit0/BankersAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banker's Algorithm :shipit:💻

The Banker's algorithm is a resource allocation and deadlock avoidance algorithm developed by Edsger W. Dijkstra that tests for safety by simulating the allocation of predetermined maximum possible amounts of all resources, and then makes an "s-state" safe state check to test for possible deadlock conditions for all other pending activities, before deciding whether allocation should be allowed to continue.

Okay, but how this thing works? 😐❓

When a new process enters a system, it must declare the maximum number of instances of each resource type that it may ever claim; clearly, that number may not exceed the total number of resources in the system. Also, when a process gets all its requested resources it must return them in a finite amount of time.