





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The banker’s algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for the predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.
Typology: Summaries
1 / 9
This page cannot be seen from the preview
Don't miss anything!
The banker’s algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for the predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.
Banker’s algorithm is named so because it is used in the banking system to check whether a loan can be sanctioned to a person or not. Suppose there are n number of account holders in a bank and the total sum of their money is S. If a person applies for a loan then the bank first subtracts the loan amount from the total money that the bank has and if the remaining amount is greater than S then only the loan is sanctioned. It is done because if all the account holders come to withdraw their money then the bank can easily do it. In other words, the bank would never allocate its money in such a way that it can no longer satisfy the needs of all its customers. The bank would try to be in a safe state always.
Following are the essential characteristics of the Banker's algorithm:
When working with a banker's algorithm, it requests to know about three things:
Goto step (2) ; else raise error condition as the process exceeds its maximum claim.
Considering a system with five processes P 0 through P 4 and three resources of type A, B, C. Resource type A has 10 instances, B has 5 instances and type C has 7 instances. Suppose at time t 0 following snapshot of the system has been taken: Steps of deadlock detection algorithm: 1.Deadlock detection algorithm will check that process requesting resources are available Request <= Available
Else, the algorithm will keep the process till its next turn. Also, detection algorithm create safe sequence i.e. sequence of resource allocated processes without any deadlock. Here, safe sequence is P1 - > P3 - > P4 - > P0 - > P