next up previous
Next: Bankers Algorithm Up: Deadlock Avoidance Previous: Deadlock Avoidance

Dijkstra's Bankers Algorithm

(encountered before in the process scheduling model)

Example : 12 tape drives, 3 users


User Current Loan Max Needed

1 1 4

2 4 6

3 5 8

Available drives = 2
Allocate 2 drives to user 2
user 2 completes and releases 6 drives
allocate 3 drives each to users 1 and 3
ALL users run to completion = SAFE STATE


User Current Loan Max Needed

1 8 10

2 2 5

3 1 3

Available = 1
If grant last drive to any user may get deadlock = UNSAFE STATE
Existence of an UNSAFE state DOES NOT imply existence or eventual existence of deadlock, e.g. user 1 may release current loan before user 1 and 2 request extra.



Omer F Rana
Sat Feb 15 21:34:55 GMT 1997