Summary ch7
Deadlock: Permanent blocking of a set of processes that either compete for system resources or communicate with each other.
Reusable Resources:
-Used by only one process at a time and not depleted by that use
-Processes obtain resources that they later release for reuse by other processes
-Processors, I/O channels, main and secondary memory, devices, and data structures such as files and databases
-Deadlock occurs if each process holds one resource and requests the other
Consumable Resources:
-Created (produced) and destroyed (consumed)
-Interrupts, signals, messages, and information in I/O buffers
Conditions for Deadlock
-Mutual exclusion: Only one process may use a resource at a time
-Hold-and-wait: A process may hold allocated resources while awaiting assignment of others
-No preemption: No resource can be forcibly removed from a process holding it
-Circular wait: A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain
Deadlock Avoidance
-A decision is made dynamically on whether the current resource allocation request will, if granted, potentially lead to a deadlock
-Requires knowledge of future process requests
-Resource-allocation-graph algorithm (Chap 7.5.2) is only applicable to systems with single instance of each resource type
-Do not grant an incremental resource request to a process if this allocation might lead to deadlock (Banker’s Algorithm)
Deadlock Avoidance
-Maximum resource requirement must be stated in advance
-Processes under consideration must be independent; their execution order must be unconstrained by any synchronization requirements
-There must be a fixed number of resources to allocate
-No process may exit while holding resources
Strategies Once Deadlock Detected
-Abort all deadlocked processes
-Back up each deadlocked process to some previously defined checkpoint, and restart all processes
-Successively abort deadlocked processes until deadlock no longer exists
-Successively preempt resources until deadlock no longer exists
Last updated
Was this helpful?