- Deadlock-prevention algorithms ensure that at least one of the necessary conditions for deadlock cannot occur and hence that
deadlocks cannot hold.
- Possible side effects of preventing deadlocks are low device utilization and reduced system throughput.
- An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested.
- For example, in a system with one tape drive and one printer, the system might need to know that process will request first the tape drive and then the printer before releasing both resources, whereas process will request first the printer and then the
tape drive.
- With this knowledge of the complete sequence of requests and releases for each process, the system can decide for each request whether or not the process should wait in order to avoid a possible future deadlock.
- Each request requires that in making this decision the system consider
- the resources currently available,
- the resources currently allocated to each process,
- the future requests and releases of each process.
- The simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need.
- Given this a priori information, it is possible to construct an algorithm that ensures that the system will never enter a deadlocked state.
- A deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that a circular-wait
condition can never exist.
- The resource-allocation state is defined by the number of available and allocated resources and the maximum demands of the processes.
Subsections
Cem Ozdogan
2011-02-14