Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2016 Set 2
Questions

Q48

MCQ2 marks, −0.67Operating systemsMedium

Consider the following two-process synchronization solution.

PROCESS 0 Process 1 Entry: loop while (turn == 1); Entry: loop while (turn == 0);(critical section) (critical section)Exit: turn = 1;Exit turn = 0; \begin{array}{|l|l|}\hline \text{PROCESS 0 } & \text{Process 1 }\\ \\ \text{Entry: loop while (turn == 1); } & \text{Entry: loop while (turn == 0);} \\ \quad\text{(critical section)} &\quad \text{ (critical section)} \\ \text{Exit: turn = 1;} & \text{Exit turn = 0; }\\ \\\hline \end{array}

The shared variable turn is initialized to zero. Which one of the following is TRUE?

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.