Question: Consider a system that deals with deadlocks by periodically detecting them and resolving them. Whenever a process requests a resource, it is granted to the

Consider a system that deals with deadlocks by periodically detecting them and resolving them. Whenever a process requests a resource, it is granted to the process if the resource is free. Otherwise, the process is blocked, waiting for the resource.
Whenever a process releases a resource, if there are other processes waiting for that resource, the resource is granted to the first waiter in the list. All other waiters now wait for the new holder of the resource to release the resource.
Periodically, a deadlock-detection algorithm is run. This algorithm builds a wait-for graph for the processes and identifies the set of processes that are deadlocked. Note that each process in the system corresponds to a vertex in the wait-for graph and an arc \(\mathrm{Pi}\rightarrow \mathrm{Pj}\) in the wait-for graph represents the fact that process Pi is waiting for a resource currently held by process Pj . When the system is ascertained to have deadlocks (i.e., the wait-for graph has cycles) one or more processes that are deadlocked (i.e., part of the cycles in the wait-for-graph) are aborted so that the system is free from deadlocks (i.e., there are no cycles in the resulting wait-for graph).
Now, consider the following sequence of resource requests in the system (note that REQ(A, B) indicates a request by process \( A \) for resource \( B \)):
- REQ(P4, R3)
- REQ(P2, R5)
- REQ(P6, R1)
- REQ(P4, R1)
- REQ(P5, R5)
- REQ(P2, R3)
- REQ(P7, R0)
- REQ(P1, R6)
- REQ(P3, R6)
- REQ(P9, R0)
- REQ(P8, R6)
- REQ(P6, R5)
- REQ(P1, R1)
- REQ(P7, R3)
After processing the above sequence of requests, let the deadlock-detection algorithm be run. Determine all of the processes that are deadlocked. Identify the process, from below, that can be aborted so that the system becomes deadlock free?
A) P2
B) P3
C) P1
D) P5
Consider a system that deals with deadlocks by

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!