Deadlock Avoidance - aryanjoshi0823/5143-Operating-System GitHub Wiki
Deadlock avoidance ensures that deadlocks are prevented proactively by carefully managing resource allocation. This approach requires additional information about processes and system states, making it a conservative strategy that can lead to reduced device utilization.
Key Concepts of Deadlock Avoidance
-
Preventing Necessary Conditions:
- Deadlock avoidance prevents at least one of the necessary conditions for deadlock from occurring.
-
Resource Allocation State:
- Defined by:
- The number of available resources.
- The number of allocated resources.
- The maximum resource requirements of all processes.
- Defined by:
-
Scheduler's Role:
- The scheduler evaluates resource requests and determines if granting them could lead to potential deadlocks.
- If a resource request or process initiation might result in a deadlock, it is denied or delayed.
-
Information Requirements:
- Basic Information: The maximum number of each resource that a process may require.
- Detailed Information (Optional): The order and schedule of resource requirements for processes.
-
Conservative Approach:
- This strategy prioritizes safety over efficiency.
- While effective in preventing deadlocks, it may result in low resource utilization.