225 views
0 votes
0 votes
Consider the following variation in Peterson’s solution for 2 processes.
shared char want[2] = {0,0};
shared int turn = 0;
1. P_i()
2. { while (1) {
3. turn = |1-i|;
4. want[i] = 1;
5. while (want [j] && turn!=i);
6. critical_section();
7. want[i] = 0;
8. remainder_section();
9. }
10. }
Which of the following statements is/are true?
i) Mutual exclusion guaranteed
ii)Progress is achieved

Please log in or register to answer this question.

Related questions