transp-deadlock

transp-deadlock - Process Deadlock A deadlock occurs when a...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Process Deadlock A deadlock occurs when a set of processes in a system is blocked waiting for events when can never happen. The problem of deadlocks is common in computer systems where resource sharing is frequent. Once a deadlock is formed, all the processes involved in the deadlock remained blocked until the deadlock is resolved through an external intervention. If deadlock is ignored in the design stage, its existence must be detected by some means and then processes must be terminated and restarted to recover from it. While the occurrence of both deadlock and starvation is due to resource sharing, deadlock differs from starvation in two aspects: 1. In starvation when and whether a process will acquire the requested resource is unpredictable, whereas a deadlocked process is permanently blocked. 2. In starvation the resource in contention continues to be in use, whereas this is not true in a deadlock. There are four necessary conditions for deadlock : 1. Mutual exclusion : At least one resource in the system is nonsharable, thus requires mutual exclusion for its access. 2. Hold and wait : Having processes that hold previously acquired resources while waiting for additional resources. 3. No preemption : At least one resource in the system cannot be preempted from a process without aborting the process. 4. Circular wait : There exists a set of blocked processes involved in a circular wait. There are three approaches for handling deadlock: 1. Deadlock prevention : A strategy where resources are granted to requesting processes in such a way that the resource allocation will never lead to deadlocks. This can be achieved by ensuring that at least one of the 4 necessary conditions for deadlock cannot hold. 2. Deadlock avoidance : In this strategy resources are granted to a requesting process only if the system state is safe in terms of leading to a deadlock. The safe state checking requires a priori information on the maximum number of resource of each type every process may need. 3. Deadlock detection/recovery : In this strategy resources are allocated to requesting processes without any check. Periodically, or as needed, the status of resource allocation and pending requests is examined to determine if a deadlock exists. If a deadlock is detected, the system recovers from it by aborting one or more of the deadlocked processes.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Two types of resources are considered: 1. Reusable resources : A resource that can be used over and over again and does not vanish as a result of its use. This type of resource has a fixed inventory in a given
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

transp-deadlock - Process Deadlock A deadlock occurs when a...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online