A set of processes is
deadlocked if each process in the set is waiting for an event that only another
process in the set can cause (including itself).
Waiting for an event could
- waiting for access to
a critical section
- waiting for a resource
Note that it is usually a non-preemptable (resource). pre-emptable resources
can be yanked away and given to another.
It could also be a situation in which two computer programs sharing the same
resource are effectively preventing each other from accessing the resource,
resulting in both programs ceasing to function.
exclusion: resources cannot be
- Hold and wait:
resources incrementally, and hold on to what they've got.
pre-emption: resources cannot be
forcibly taken from processes.
circular chain of waiting, in which each process is waiting for a resource
held by the next process in the chain.
for dealing with Deadlock
- ignore the problem
altogether ie. ostrich algorithm it may occur very infrequently, cost of
detection/prevention etc may not be worth it.
- detection and recovery
- avoidance by careful
- prevention by
structurally negating one of the four necessary conditions.
Designed by: Harriet B. Nyakaana