Deadlocks
Deadlocks
• If a system has two CPUs, then the resource type CPU has two instances.
• Similarly, the resource type printer may have five instances.
• If a process requests an instance of a resource type, the allocation of any
instance of the type should satisfy the request.
• If it does not, then the instances are not identical, and the resource type
classes have not been defined properly.
System Model - Sequence of Resource Utilization
• Under the normal mode of operation, a process utilize a resource in only the
following sequence:
• 1. Request.
• The process requests the resource.
• If the request cannot be granted immediately then the requesting
process must wait until it can acquire the resource.
• 2. Use.
• The process can operate on the resource.
• 3. Release.
• The process releases the resource.
Necessary Conditions
• 1. Mutual exclusion.
• 2. Hold and wait.
• 3. No preemption.
• 4. Circular wait.
1. Mutual exclusion