Single Instance of Each Resource Type

Q2. What happens when a Single Instance of Each Resource Type is present?

Ans.

Maintain wait for graph

Node are processes

Pi → Pj,

if Pi is waiting for Pj.

Invoke an algorithm that searches for cycle in the graph. If there is a cycle, there exists a deadlock.

An algorithm to detect a cycle in the graph requires an order of n2 operations, where n=number of vertices or processes in the graph.

Resource Allocation Graph

Figure: Resource Allocation Graph

 

Note:

  • Process(P) to Resource(R) is a Request.
  • Request (R) to Process (P) is a Assignment.

Wait for Graph

Figure: Wait for Graph

Leave a Reply

Your email address will not be published. Required fields are marked *

260 Views
%d bloggers like this: