An Ultimate Guides to Banker’s Algorithm in Operating System

Mahesh Sharma
2 min readJul 29, 2021

What is Banker’s Algorithm?

Banker’s Algorithm It is used to prevent bank system deadlock. It allows you to determine whether a loan will or not be granted.

This algorithm simulates the allocation to determine the maximum amount of resources. Before deciding whether to continue allocation, it checks for all possible activities.

One example is that there are X bank account holders and their total money is G.

The software system subtracts from total money the amount of the loan that was granted to purchase a vehicle (G+ Fixed deposit + Monthly income Scheme + Gold) The bank has.

Banker’s algorithm notations

This is an important notation that Banker uses in his algorithm:

  • X: Indicates how many processes are in the system.
  • Y: Indicates how many resources are in the system.

Available

[I:Y] indicates which resource is available.

Max

[l:X:Y]: Expression of the maximum number resources for type j/process i

Allocation

[l:X.l:Y]. Indicate the location where you received a resource type j

Need

Describe how many additional resources could be allocated in the future

Characteristics of Banker’s Algorithm

These are the key characteristics of a banker’s algorithm.

  • You should have at least one client in mind.
  • A process must return all of its resources within a specified time frame when it has exhausted all of its resources.
  • Waiting is necessary when a process requests a resource.
  • The system is limited in its resources
  • Advanced feature to maximize resource allocation

Disadvantage of Banker’s algorithm

These are the cons and drawbacks to using banker’s algorithms

  • Process cannot be modified to meet its maximum need during processing
  • All requests can be granted within a limited time frame, but one year is the maximum period.
  • Every process must be able to identify and estimate their maximum resource requirements in advance.

Summary:

  • The Banker’s algorithm is a key tool in the banking system to avoid bankruptcies. It allows you to determine whether a loan will or not be granted.
  • Banker’s algorithms use the following notations: 1) Available 2) Max 3 3) Allocation 4 4) Need
  • The resource request algorithm allows you to show the system behavior during a specific process making a request for resources.
  • The Banker’s algorithm ensures that there are at least one client who is satisfied with the resources available.
  • Banker’s algorithm has the biggest flaw: it doesn’t allow for processing to be modified at its Maximum need.

--

--

Mahesh Sharma

Hey, I'm Mahesh Sharma, a passionate digital marketer with 10+ years of experience in the field. I'll be sharing topics such as SEO, SMO, PPC/ SEM.