Process 1 Process 1 while (TRUE) while (TRUE) { { // wait while (turn != 1); // wait while (turn != 2); critical section(); turn = 1; critical section (); turn = 2; noncritical section (); noncritical...


Part(a): Explain Race Condition with example.


Part(b): What are the conditions that need to hold to solve critical section problem? Explain.


Part(c): What is the problem with the following algorithm?


Process 1<br>Process 1<br>while (TRUE)<br>while (TRUE)<br>{<br>{<br>// wait<br>while (turn != 1);<br>// wait<br>while (turn != 2);<br>critical section();<br>turn = 1;<br>critical section ();<br>turn = 2;<br>noncritical section ();<br>noncritical section ();<br>}<br>

Extracted text: Process 1 Process 1 while (TRUE) while (TRUE) { { // wait while (turn != 1); // wait while (turn != 2); critical section(); turn = 1; critical section (); turn = 2; noncritical section (); noncritical section (); }

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here