Header Ads

Draw the Resource Allocation Graph from the given process states information of a system and identify the processes if any cycle is created in the graph.

Draw the Resource Allocation Graph from the given process states information of a system and identify the processes if any cycle is created in the graph.



style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-7200085558568021"
data-ad-slot="3193586076">





P = P1, P2, P3, P4, P5

R = R1, R2, R3

E = { P1 → R1, P1 → R2, P2 → R1, P3 → R3, P4→R3, P5→ R3, R1 → P4, R2 → P2,

R2 → P5, R3→P2 }

Resource Instances

·         One instance of resource type R1

·         Two instances of resource type R2

·         One instance of resource type R3

Solution:

Based on the given process states information of a system, the RAG can be drawn as follows:

    P1---->R1

   
|      |

   
|      |

   
V      V

   
P2---->R2---->P4

   
|      |      |

   
|      |      |

   
V      V      V






style="display:block"
data-ad-format="autorelaxed"
data-ad-client="ca-pub-7200085558568021"
data-ad-slot="6426802817">













   
P3---->R3---->P5

In the above graph, it can be seen that there is a cycle created in the graph, which is P2 -> R2 -> P5 -> R3 -> P2. This means that there is a Deadlock situation in the system. This is because P2 holds R2 and waiting for R3, P5 holds R3 and waiting for R2, and thus the processes are waiting for each other.

No comments

Powered by Blogger.