What is resource allocation graph? Explain the process of detecting deadlocks when there is single instance of each resources with suitable example?

This answer is restricted. Please login to view the answer of this question.

Login Now

The resource allocation graph is a directed graph that briefs about the deadlock more precisely. This is the principal representation showing processes requested resources and assigned resources. In RAG, vertices and edges are present.

Vertices are of two types:

  1. Process vertex
  2. Resource vertex

and resources are of two types

  1. Single instance
  2. Multiple instances

Let’s take an example of a single instance of RAG

Single Instance Resource with/without deadlock

Here, we can see in fig(i), If there is a cycle in RAG and each resource in the cycle provides only one instance, then the process will be in a deadlock.

In fig (2), there is no deadlock because there is no circular dependency. So, a cycle in a single instance resource type is a sufficient condition for deadlock.

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .