Question: please read the question a similar one has already been posted by me, this question is not the same Assuming we have the following 3
please read the question a similar one has already been posted by me, this question is not the same
Assuming we have the following 3 processes trying to access 6 resources.
We know deadlock is possible. How can you change the order of resource requests so that there is no deadlock? Obviously, the critical region of each process cannot be changed, therefore, it must be ensured that all required resources are actually acquired.

void P2() void PO () { while (true) { get (A); get (B); get (C); // critical region: // use A, B, C release (A) ; release (B); release (C); } } void P1 () { while (true) { get (D); get (E); get (B); // critical region: // use D, E, B release (D); release (E) ; release (B); } } while (true) { get (C); get (F); get (D); // critical region: // use C, F, D release (C); release (F); release (D); } void P2() void PO () { while (true) { get (A); get (B); get (C); // critical region: // use A, B, C release (A) ; release (B); release (C); } } void P1 () { while (true) { get (D); get (E); get (B); // critical region: // use D, E, B release (D); release (E) ; release (B); } } while (true) { get (C); get (F); get (D); // critical region: // use C, F, D release (C); release (F); release (D); }
Step by Step Solution
There are 3 Steps involved in it
To prevent deadlock we can use a method such as ensuring a consistent ordering of resource requests ... View full answer
Get step-by-step solutions from verified subject matter experts
