title: What will happen if we reorder the commands in Peterson's algorithm for mutual exclusion?
body: <p>I have read this for Peterson's algorithm for mutual exclusion.Then there was the question what will happen if we reorder the first and second command in the do...while loop? I cannot see something happening if we do that...Can someone tell me what I am missing?</p>
  
  <pre><code>do {
       flag[me] = TRUE;
       turn = other;
       while (flag[other] &amp;&amp; turn == other)
               ;
       critical section
       flag[me] = FALSE;
       remainder section
     } while (TRUE);
  </code></pre>