333 views
4 votes
4 votes
Which of the following is/are correct? (Mark all the appropriate choices)
  1. If each resource type has exactly one instance, then a cycle in resource allocation graph is a necessary condition for the existence of deadlock
  2. If each resource type has exactly one instance, then a cycle in the resource allocation graph is a sufficient condition for the existence of deadlock
  3. If each resource type has several instances, then a cycle in the resource allocation graph is a sufficient condition for the existence of deadlock
  4. If each resource type has several instances, then a cycle in the resource allocation graph is a necessary condition for the existence of deadlock

2 Answers

4 votes
4 votes
If each resource type has exactly one instance, then a cycle in resource allocation graph is both a necessary and a sufficient condition for the existence of deadlock.

If each resource type has several instances, then a cycle in the resource allocation graph is a necessary condition for the existence of deadlock but not sufficient. That is, even if there is a cycle, a deadlock may not be present.
1 votes
1 votes

If the graph contains no cycles $\implies$ no deadlock.

If the graph contains a cycle $\implies$

  •  if only one instance per resource type, then deadlock.
  •  if several instances per resource type, possibility of deadlock.

So, the correct answer is $A; B; D.$ 

Ref:https://www.cs.odu.edu/~cs471w/spring10/lectures/Deadlocks.htm

edited by
Answer:

Related questions