Consider the following solution of critical section for two processes: Boolean…
Consider the following solution of critical section for two processes:
Boolean val[2] = {false,false};
int turn = 0;
void Pi(){
while(1){
val[i] = true;
turn = j;
while(val[j] && turn == j);
/// critical section////
val[i] = false;
}}
Here val and turn are shared variables between two processes P0 and P1, than which of the following is true about above solution ?
- A.
Satisfy mutual exclusion and process both
- B.
Satisfy process and bounded wait but not mutual exclusion
- C.
Satisfy mutual exclusion but not process both
- D.
Doesn’t satisfy any of mutual exclusion, process and bounded wait
Attempted by 332 students.
Sign up free to check your answer
Sign up freeLoading lesson…

