Deadlock Summ
Deadlock Summ
Deadlock Summ
Amiel
Deadlocks - permanent blocking of a set of processes that either compete for
system resources or communicate with each other.
- A set of processes is deadlocked when each process in the set is
blocked waiting for an event, typically freeing up some requested resource that
can only be triggered by another blocked process in the set.
- Note that all deadlocks involve conflicting needs for resources by two
(2) or more processes.
1. Reusable resources – These resources can be used by only one process at a time
and are not depleted by usage.
Example: Consider two (2) programs that compete for exclusive access to
a disk file D and a tape drive T. Deadlock occurs if each process holds one (1)
resource and requests the other.
Christopher
resource ceases to exist.
Example: Consider a pair of processes in which each process attempts to
receive a message from the other process, then sends a message to the other.
Deadlock occurs if the receiving process is blocked until the message is received.
Resource allocation graph
- Introduced by Richard Holt
- A useful tool in characterizing the allocation of resources to processes.
- It is a directed graph that depicts the state of system resource processes,
wherein processes and resources are represented by nodes
connected by edges.
Nathaniel
assigned to the process.
⚫ An edge directed from a consumable resource node dot to a process
indicates the process is the procedure of that resource.
1. Mutual exclusion:
- At least one resource must be held in a non-shareable mode. This means
that only one (1) thread at a time can use the resource.
- If another thread requests that specific resource, the requesting thread must
be delayed until the resource has been released.
2. Hold and wait:
- A thread must be holding at least one (1) resource and waiting to acquire
additional resources that are currently being held by other threads.
3. No preemption:
- Resources cannot be preempted. This means that a resource can only be
released voluntarily by the thread holding it after that thread has completed its
task.
Kenneth
4. Circular wait:
- A closed chain of threads exists, such that each thread holds at least one
resource needed by the next thread in the chain.
Note:
- The first three (3) conditions are necessary, but not sufficient, for a
deadlock to occur.
- The fourth condition is required for a deadlock to actually take place.
Technically, the fourth condition is the potential consequence of the first three
conditions.
- Deadlock can also be described as an unresolved circular wait.
- This strategy allows the three necessary conditions but makes judicious
Christopher
choices to assure that the deadlock point is never reached. Thus, allowing more
concurrency.
- With deadlock avoidance, decisions are made dynamically. Hence,
knowledge of future process resource requests must be known.
A. Process initiation denial: Do not start a process if its demands might lead to a
deadlock; and
B. Resource allocation denial: Do not grant an incremental resource request to a
process if this allocation might lead to a deadlock.
Nathaniel
⚫ The maximum resource requirement for each process must be stated in
advance;
⚫ The processes under consideration must be unconstrained by any
synchronization requirements;
⚫ There must be a fixed number of resources to allocate; and
⚫ No process may exit while holding resources.
– This strategy does not limit resource access or restricts process executions.
Amiel
1. Requested resources are granted to processes whenever possible.
2. Then, the operating system periodically executes an algorithm that detects the
3. Once the deadlock has been detected, any of the following recovery methods
can be performed, whichever is more appropriate for the program (Stallings, 2018):
Recovery Methods:
Kian Geoff
C. Successively abort deadlocked processes until deadlock no longer exists. After
each abortion, the detection algorithm must be re-invoked to see whether a
deadlock still exists.
D. Successively preempt resources until deadlock no longer exists. A process that
encompasses preempted resource must be rolled back to the point prior to its
resource acquisition.