title: Volatile in C++11
body: <p>In C++11 standard the machine model changed from a single thread machine to a multi threaded machine.</p>
  
  <p>Does this mean that the typical <code>static int x; void func() { x = 0; while (x == 0) {} }</code> example of optimized out read will no longer happen in C++11?</p>
  
  <p>EDIT: for those who don't know this example (I'm seriously astonished), please read this: <a href="https://en.wikipedia.org/wiki/Volatile_variable">https://en.wikipedia.org/wiki/Volatile_variable</a></p>
  
  <p>EDIT2:
  OK, I was really expecting that everyone who knew what <code>volatile</code> is has seen this example.</p>
  
  <p>If you use the code in the example the variable read in the cycle will be optimized out, making the cycle endless.</p>
  
  <p>The solution of course is to use <code>volatile</code> which will force the compiler to read the variable on each access.</p>
  
  <p>My question is if this is a deprecated problem in C++11, since the machine model is multi-threaded, therefore the compiler should consider concurrent access to variable to be present in the system.</p>