751 views
3 votes
3 votes

Consider the following two-process synchronization solution.

Process 0
---------
Entry: loop while (turn == 1);
(critical section)
Exit: turn = 1;
Process 1
----------
Entry: loop while (turn == 0);
(critical section)
Exit: turn = 0;

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

(A) This is a correct two-process synchronization solution.
(B) This solution violates mutual exclusion requirement.
(C) This solution violates progress requirement.
(D) This solution violates bounded wait requirement.

Please log in or register to answer this question.

Related questions

753
views
0 answers
0 votes
OneZero asked Jan 15, 2019
753 views
Consider the following program segments for two different processes (P1, P2) executing concurrently and where a and b are not shared variables, but x starts at ... once and concurrently, then the final minimum possible value of x is ____
1.5k
views
0 answers
0 votes
Raj Singh 1 asked Jan 1, 2019
1,503 views
Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain ... all those problems incorrect? Or I am screwed up at my concepts?
4.6k
views
3 answers
4 votes
Na462 asked Jul 18, 2018
4,610 views
Consider the following code to solve the critical section problem for two processes P0 and P1. Initially flag [i] contain false for i = 0 and 1 ... Mutual exclusion and progressB. Mutual exclusion and bounded waitC. ProgressD. None of these
306
views
0 answers
0 votes
Akash Kumar Roy asked Mar 31, 2018
306 views
Is context switch allowed when a process is in the cirtical section? (Not preemption)If yes then how it deals with data inconsistency?