For those interested in the implementation of atomic operations see Jeff Preshing's "How Ubisoft Develops Games for Multicore - Before and After C++11", especially after 15m55s in on the video, or slide 37 of the pdf on github.
Video: https://www.youtube.com/watch?v=X1T3IQ4N-3g&feature=youtu.be...
PDF: https://github.com/CppCon/CppCon2014/tree/master/Presentatio...