Question: In the code below, three processes are competing for six resources labeled A to F. a. Using a resource allocation graph, show the possibility of
In the code below, three processes are competing for six resources labeled A to F.
a. Using a resource allocation graph, show the possibility of a deadlock in this implementation.
b. Modify the order of some of the get requests to prevent the possibility of any deadlock. You cannot move requests across procedures, only change the order inside each procedure. Use a resource allocation graph to justify your answer.
.png)
void P0 () void P1 () void P2 () while (true) while (true) ( while (true) get (A) get (B) get (C) // critical region: // use A, B, C release (A) release (B) release (C); get (D) get (E) get (B) // critical region: // use D, E, B release (D) release (E) release (B) get (C) get (F)i get (D) // critical region: // use C, F, D release (C); release (F) release (D)
Step by Step Solution
3.35 Rating (167 Votes )
There are 3 Steps involved in it
a There is a deadlock if the scheduler goes for example P0P1P2P0P1P2 line by line Each of the 6 reso... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
451-C-S-D-B-O-S (93).docx
120 KBs Word File
