RESOURCE ALLOCATION GRAPH



(0)A Resource Allocation Graph

_This RAG shows a cycle of 3 processes and 4 resource types.






(0) Resource Allocation Graph with deadlock.

-First P1 have a request to R1.The instance of R1 has been hold by P2. This process then sends request to R3 , and P3 is holding its instance. When P3 sends request to R2, which consists of 2 instances. One instance holds by P2 while the other one holds by P1. There exist the deadlock when the instances of two different resource type are been holds by one Process(P2) at the same time.





(0) Resource allocation graph with a cycle but no deadlock

- The graph contains a cycle. Each processes holds an instance of the resource. First, P1 sends request to R1, which contains 2 instances. P2 and P3 are holding these instances . Then, P3 sends request to R2 which also contains 2 instances and each of these are holds by P4 and P1.






(0)Resource allocation graph for deadlock Avoidance

_for deadlock avoidance, it will ensure that a system will never enter an unsafe state. P1 holds the resource type (R1) and P1 then sends request to R2. P2 at the same time sends request to two different resource type.



(0) Unsafe State in a Resource Allocation Graph

_if the system is in unsafe state, there's a possibility of deadlock.



0 comments:

Post a Comment