title: Why doesn't the OpenMP atomic directive support assignment?
body: <p>The atomic directive in openmp supports stuff like</p>
  
  <pre><code>x += expr
  x *= expr
  </code></pre>
  
  <p>where expr is an expression of scalar type that does not reference x. I get that, but I don't get why you can't do:</p>
  
  <pre><code>#pragma omp atomic
  x = y;
  </code></pre>
  
  <p>Is this somehow more taxing cpu instruction-wise? Seems to me that both the legal and illegal statement loads the value of x and some other scalar value, changes the register value of x and writes it back. If anyone could explain to me how these instructions are (I assume) fundamentally different I would be very grateful.</p>