Critical Section Problem: Algorithm 1


Use the common variable turn to determine which process may enter the critical section. If turn = i then process Pi is allowed to execute it's critical section.


repeat

        while turn != i do no-op;

                critical section

        turn := j;

                remainder section

until false;


This does not satisfy the progress requirement because there is strict alternation between the processes.