\(P = \{P_1, P_2, P_3, P_4\}\) consists of all active processes in an operating system.
\(R = \{R_1, R_2, R_3, R_4\}\) consists of single instances of distinct types of resources in the system.
The resource allocation graph has the following assignment and claim edges.
Assignment edges: \(R_1 \to P_1,\ R_2 \to P_2,\ R_3 \to P_3,\ R_4 \to P_4\) (the assignment edge \(R_1 \to P_1\) means resource \(R_1\) is assigned to process \(P_1\), and so on for others)
Claim edges: \(P_1 \to R_2,\ P_2 \to R_3,\ P_3 \to R_1,\ P_2 \to R_4,\ P_4 \to R_2\) (the claim edge \(P_1 \to R_2\) means process \(P_1\) is waiting for resource \(R_2\), and so on for others)
Which of the following statement(s) is/are CORRECT?
Answer
(C), (D)
Explanation
Every resource has a single instance, so a cycle means deadlock. Turn each edge pair into a waits-for edge between processes: \(P_1 \to P_2\) (for \(R_2\)), \(P_2 \to P_3\) (for \(R_3\)), \(P_2 \to P_4\) (for \(R_4\)), \(P_3 \to P_1\) (for \(R_1\)) and \(P_4 \to P_2\) (for \(R_2\)). That gives two cycles, \(P_1 \to P_2 \to P_3 \to P_1\) and \(P_2 \to P_4 \to P_2\), and both pass through \(P_2\).
- Aborting \(P_1\) leaves the cycle \(P_2 \to P_4 \to P_2\) (A false).
- Aborting \(P_3\) leaves the same cycle (B false).
- Aborting \(P_2\) breaks both cycles (C true).
- Aborting \(P_1\) and \(P_4\) removes a process from each cycle; only \(P_2 \to P_3\) remains (D true).
Answer: C, D