Next: Bankers Algorithm
Up: Deadlock Avoidance
Previous: Deadlock Avoidance
(encountered before in the process scheduling model)
- Process need = Maximum quantity of each resource that process requires during its
lifetime.
- Resource Manager (Banker) = needs prior knowledge of all process claims
- Process requests ONE resource at a time
- Current process request is allowed if :
the request plus current usage of the processes is less than the need
after allocating the request there exists a sequence in which all processes can run
to completion even if they demand their full claim - SAFE STATE
- Users must guarantee to release resources in finite time
- Resource manager guarantees to allocate resources in finite time
Process
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