Why isn't the test in strict alternation for the first entrance for process 0 while ( turn == 0) //then enter How can process 0 enter while (turn != 0), is'nt this the same as while (turn == 1) ?
turn = 0;
//process 0 to enter
while (TRUE) {
while (turn != 0)
critical_region();
turn = 1;
noncritical_region();
}
//process 1 to enter
while (TRUE) {
while (turn != 1)
critical_region();
turn = 0;
noncritical_region();
}