# Summary ch7

1. Deadlock: Permanent blocking of a set of processes that either compete for system resources or communicate with each other.
2. Reusable Resources:  &#x20;

   -Used by only one process at a time and not depleted by that use &#x20;

   -Processes obtain resources that they later release for reuse by other processes &#x20;

   -Processors, I/O channels, main and secondary memory, devices, and data structures such as files and databases &#x20;

   -Deadlock occurs if each process holds one resource and requests the other
3. Consumable Resources: &#x20;

   -Created (produced) and destroyed (consumed) &#x20;

   -Interrupts, signals, messages, and information in I/O buffers &#x20;
4. Conditions for Deadlock &#x20;

   -Mutual exclusion: Only one process may use a resource at a time  &#x20;

   -Hold-and-wait: A process may hold allocated resources while awaiting assignment of others   &#x20;

   -No preemption: No resource can be forcibly removed from a process holding it &#x20;

   -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
5. Deadlock Avoidance &#x20;

   -A decision is made dynamically on whether the current resource allocation request will, if granted, potentially lead to a deadlock   &#x20;

   -Requires knowledge of future process requests &#x20;

   -Resource-allocation-graph algorithm (Chap 7.5.2) is only applicable to systems with single instance of each resource type &#x20;

   -Do not grant an incremental resource request to a process if this allocation might lead to deadlock (Banker’s Algorithm)
6. Deadlock Avoidance &#x20;

   -Maximum resource requirement must be stated in advance &#x20;

   -Processes under consideration must be independent; their execution order must be unconstrained by any synchronization requirements &#x20;

   -There must be a fixed number of resources to allocate &#x20;

   -No process may exit while holding resources &#x20;
7. Strategies Once Deadlock Detected &#x20;

   -Abort all deadlocked processes &#x20;

   -Back up each deadlocked process to some previously defined checkpoint, and restart all processes &#x20;

   -Successively abort deadlocked processes until deadlock no longer exists &#x20;

   -Successively preempt resources until deadlock no longer exists
