Added Resource Allocation Graphs (#30118)

Added an explanation about resource allocation graphs, and how a deadlock can be determined from one. Created a hyperlink to a separate page that goes into more detail about these types of graphs.
This commit is contained in:
Christian Coffey
2018-12-20 18:12:20 -05:00
committed by Christopher McCormack
parent f7b861e577
commit 2d0a63c9e0

View File

@ -28,6 +28,12 @@ Deadlock can arise if four conditions hold simultaneously.
- **No preemption** : a resource can be released only voluntarily by the process holding it, after that process has completed its task. - **No preemption** : a resource can be released only voluntarily by the process holding it, after that process has completed its task.
- **Circular wait** : there exists a set { P<sub>0</sub>, P<sub>1</sub>, …, P<sub>0</sub> } of waiting processes such that P<sub>0</sub> is waiting for a resource that is held by P<sub>1</sub>, P<sub>1</sub> is waiting for a resource that is held by P<sub>2</sub>, …, P<sub>n 1</sub> is waiting for a resource that is held by P<sub>n</sub>, and P<sub>0</sub> is waiting for a resource that is held by P<sub>0</sub>. - **Circular wait** : there exists a set { P<sub>0</sub>, P<sub>1</sub>, …, P<sub>0</sub> } of waiting processes such that P<sub>0</sub> is waiting for a resource that is held by P<sub>1</sub>, P<sub>1</sub> is waiting for a resource that is held by P<sub>2</sub>, …, P<sub>n 1</sub> is waiting for a resource that is held by P<sub>n</sub>, and P<sub>0</sub> is waiting for a resource that is held by P<sub>0</sub>.
### Resource Allocation Graphs
Possible deadlocks can be discovered through the use of resource allocation graphs, which outline processes and the resources they require. If a cycle exists, so does a potential deadlock.
#### Resource Allocation Graph Example
![resource allocation graph example](http://www.cs.fsu.edu/~baker/cop5611.S03/graphics/basicdeadlock2.gif)
### Methods for Handling Deadlocks ### Methods for Handling Deadlocks
- Put the system in a situation where the deadlock can be avoided, i.e. Deadlock Avoidance. - Put the system in a situation where the deadlock can be avoided, i.e. Deadlock Avoidance.
- Ensure that the system will never enter a deadlock state. - Ensure that the system will never enter a deadlock state.
@ -79,3 +85,4 @@ Need (Max Allocation)
#### More information : #### More information :
- [Deadlock](https://en.wikipedia.org/wiki/Deadlock) - [Deadlock](https://en.wikipedia.org/wiki/Deadlock)
- [Operating System | Process Management | Deadlock Introduction](https://www.geeksforgeeks.org/operating-system-process-management-deadlock-introduction/) - [Operating System | Process Management | Deadlock Introduction](https://www.geeksforgeeks.org/operating-system-process-management-deadlock-introduction/)
- [Resource Allocation Graphs](https://www.geeksforgeeks.org/operating-system-resource-allocation-graph-rag/)