diff --git a/guide/english/computer-science/deadlock/index.md b/guide/english/computer-science/deadlock/index.md index de21e64136..dd6ddf1561 100644 --- a/guide/english/computer-science/deadlock/index.md +++ b/guide/english/computer-science/deadlock/index.md @@ -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. - **Circular wait** : there exists a set { P0, P1, …, P0 } of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn –1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0. +### 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 - 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. @@ -79,3 +85,4 @@ Need – (Max – Allocation) #### More information : - [Deadlock](https://en.wikipedia.org/wiki/Deadlock) - [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/)