Difference from avoidance
is that here, the system itself is build in such a way that there are no
deadlocks.
Make sure at least one of
the 4 deadlock conditions is never satisfied.
This may however be even
more conservative than deadlock avoidance strategy.
Avoid actions that may lead
to a deadlock.
Think of it as a state
machine moving from 1 state to another as each instruction is executed.
Safe state is one where
To avoid deadlocks, we try
to make only those transitions that will take you from one safe state to
another. We avoid transitions to unsafe state (a state that is not deadlocked,
and is not safe)
e.g.Total of instances of resource = 12 (Max, Allocated, Still Needs)P0 (10, 5, 5) P1 (4, 2, 2) P2 (9, 2, 7) Free = 3 - SafeThe sequence is a reducible sequence, the first state is safe. What if P2 requests 1 more and is allocated 1 more instance?- Results in Unsafe state So do not allow P2's request to be satisfied.
Designed by: Harriet B. Nyakaana