OS-Deadlock Avoidance and Bankers Algorithm

Deadlock can be avoided by being careful when resources are allocated. The most famous deadlock avoidance algorithm is Dijkstra’s Banker’s a...

Deadlock can be avoided by being careful when resources are allocated. The most famous deadlock avoidance algorithm is Dijkstra’s Banker’s algorithm, because it involves a banker who makes loans and receives payments from a given source of capital.

DIJKSTRA’S BANKERS ALGORITHM:

Resource of the same type for example consider the allocation of a quantity, t, of identical tape drives.
  1.  An operating system shares a fixed number of equivalent tape drives, t, among a fixed number of users u. Each user specifies in advance the maximum number of tape drives required during the execution of the job on the system.
  2.  The operating system will accept a users request if that users maximum need for tape drives does not exceed it.
  3.  A user may obtain or release tape drives one by one. Sometimes, a user may have to wait to obtain an additional tape drive, but the operating system guarantees a finite wait. The current number of tape drives allocated to a user will never exceed that user’s stated maximum need.
  4.  If the operating system is able to satisfy a user’s maximum need for tape drives, then the user guarantees that the tape drives, then the user guarantees that the tape drives will be used and released to the operating system within a finite time.
  5.  The current state of the system is called Safe if it is possible for the operating system to allow all current users to complete their jobs withing a finite time. If not, then the current system state is called Unsafe.
Now suppose there are n user.

Loan(i) represents user i’s current loan of tape drives. Max(i) be the maximum need of user i. Claim (i) be the current claim of a user where a user’s claim is equal to his maximum need minus the user’s current loan.

BANKER’S ALGORITHM RESOURCE ALLOCATION:

In Dijkstra’s Banker’s Algorithm “Mutual Exclusion”, “wait-for”, and “no-preemption” conditions are allowed. The system grants request that result in safe states only. A users request that would result in an unsafe state is repeatedly denied until that request can eventually be satisfied.

Weaknesses in the Bankers Algorithm:
  1.  The algorithm requires fixed number of resources to allocate. Since resources require service, either because of breakdowns or maintenance. So resource cannot be fixed.
  2.  The algorithm requires users remain fixed. In todays multiprogrammed systems, the user is constantly changing.
  3.  The algorithm requires that the banker grant all requests within a finite time. Clearly much better guarantees than this are needed in real systems.
  4.  Similarly, the algorithm requires that clients repay all loans within a finite time. Much better guarantees than this are needed in real systems. 
  5. The algorithm requires that users state their maximum needs in advance. It is difficult to predict the users maximum need
Name

ADO,131,ASP,3,C++,61,CORE JAVA,1,CSS,115,HTML,297,index,5,JAVASCRIPT,210,OS,47,PHP,65,SAD,53,SERVLETS,23,SOFTWARE ENGINEERING,245,SQL,71,TCP/IP,1,XHTML,9,XML,18,
ltr
item
Best Online Tutorials | Source codes | Programming Languages: OS-Deadlock Avoidance and Bankers Algorithm
OS-Deadlock Avoidance and Bankers Algorithm
Best Online Tutorials | Source codes | Programming Languages
https://www.1000sourcecodes.com/2012/09/os-deadlock-avoidance-and-bankers.html
https://www.1000sourcecodes.com/
https://www.1000sourcecodes.com/
https://www.1000sourcecodes.com/2012/09/os-deadlock-avoidance-and-bankers.html
true
357226456970214079
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content