title: Are hoisting and reordering the same thing?
body: <p>I read from <a href="http://books.google.co.in/books/about/Effective_Java.html?id=Ft8t0S4VjmwC&amp;redir_esc=y" rel="noreferrer">Effective Java</a> that In the absence of synchronization the following sequence A below can be converted into sequence B by the virtual machine and this is called <code>hoisting</code>. I also read somewhere that if variables are not declared as volatile instructions involving the variables  can be reordered . Are hoisting and reordering the same thing?</p>
  
  <pre><code>  while (!done)    sequence A     
      i++;
  
    if (!done)
       while (true)    sequence B
          i++;
  </code></pre>