title: Atomic instruction : How can other thread update the value while Compare and Swap instruction is in progress?
body: <p>As per my understanding, any atomic instructions(compare_and_swap, test_and_test, fetch_and_add) are executed as a single instruction. Though they involve multiple CPU cycles/operations, it is invisible to the thread/process. If a thread is executing any such atomic instruction, no other thread is allowed to modify/access any values(memory locations/registers) involved in such atomic instruction.</p>
  
  <p>If that is the case, Why in wikipedia <a href="http://en.wikipedia.org/wiki/Compare-and-swap" rel="nofollow">http://en.wikipedia.org/wiki/Compare-and-swap</a>, it is stated that <strong><em>if the value had been updated by another thread in the meantime, the write would fail.</em></strong> ?</p>
  
  <p>How can other thread update the value while compare_and_swap instruction in one thread is under progress ?</p>