This preview shows page 1. Sign up to view the full content.
Unformatted text preview: he three operations, allocate is the only operation that the system
can control. The other two operations are initiated by a process.
With the above mentioned pattern of request, allocation, and release of resources,
if the total request made by multiple concurrent processes for resources of a
certain type exceeds the amount available, some strategy is needed to order the
assignment of resources in time. Care must be taken that the strategy applied
cannot cause a deadlock, that is, a situation in which competing processes prevent
their mutual progress even though no single one requests more resources than are
available. It may happen that some of the processes that entered the waiting state
(because the requested resources were not available at the time of request) will
never again change state, because the resources they have requested are held by
other waiting processes. This situation is called deadlock, and the processes
involved are said to be deadlocked. Hence, deadlock is the state of permanent
blocking of a set of processes each of which is waiting for an event that only
another process in the set can cause. All the processes in the set block permanently
because all the processes are waiting and hence none of them will ever cause any
of the events that could wake up any of the other members of the set.
A deadlock situation can be best explained with the help of an example (see Figure
14.26). Suppose that a system has two tape drives T } and T2 and the resource
allocation strategy is such that a requested resource is immediately allocated to the
requesting process if the resource is free. Also suppose that two concurrent
processes P1 and P2 make requests for the tape drives in the following order:
1. P1 requests for one tape drive and the system allocates Tj to it.
2. P2 requests for one tape drive and the system allocates T2 to it.
3. P1 requests for one more tape drive and enters a waiting state because no tape
drive is presently available. 4. P2 requests for one more tape drive and...
View Full Document
This document was uploaded on 04/07/2014.
- Spring '14