-
- C: Current Allocation Matrix
- A: Resources Available
- E: Resources in Existence
- Add up all the instances of the resource that have been allocated and to this add all the instances that are available, the result is the number of instances of that resource class that exist
- At any instant of time, there is a current state consisting of E, A, C, and R (Request Matrix)
- A state is said to be safe if it is not deadlocked and there is some scheduling order in which every process can run to completion even if all of them suddenly request their maximum number of resources immediately
- A total of 10 instances of the resource exist, so with 7 resources already allocated, there are 3 still free
- The upper state of Fig 2 is safe because there exist a sequence of allocations (scheduler runs B) that allows all processes to complete; by careful scheduling, can avoid deadlock
- The lower state of Fig 2 is not safe because this time scheduler runs A and A gets another resource
- There is no sequence that guarantees completion
- An unsafe state is not a deadlock state
- The difference between a safe state and an unsafe state is that from a safe state the system can guarantee that all processes wili finish; from an unsafe state, no such guarantee can be given
Figure 2:
Demonstration that the state in is safe (upper), and in is not safe (lower).
|
2004-04-18