4 ms·
Intel memory ordering, fence instructions, and atomic operations (2009)
- cokernel_hacker 12y agoThe state of the X86 memory model before 2009 was quite poor [1]. All Intel had to offer was a whitepaper on memory ordering and it contained terms which weren't defined like "causality" and "transitive visibility". As a person who lives in these trenches, I cannot stop myself from pushing others to read the fantastic X86-TSO paper by Sewell et al [2]. It gives a clear, easily understood view of the memory model. Their earlier, more in-depth paper, is here [3]. [1] http://www.mpdiag.com/intel_arch.html http://www.mpdiag.com/intel_arch.html [2] http://www.cl.cam.ac.uk/~pes20/weakmemory/cacm.pdf http://www.cl.cam.ac.uk/~pes20/weakmemory/cacm.pdf [3] http://www.cl.cam.ac.uk/~pes20/weakmemory/x86tso-paper.pdf http://www.cl.cam.ac.uk/~pes20/weakmemory/x86tso-paper.pdf
- stplsd 12y agoFunny thing, Just yesterday I did not know almost anything about memory models, cache coherence, etc. Then I've read this book/lecture [1], got interested and later found the same great articles by Peter Sewell[2], you've mentioned And today I see it on hacker news :) [1] http://www.morganclaypool.com/doi/abs/10.2200/S00346ED1V01Y201104CAC016 http://www.morganclaypool.com/doi/abs/10.2200/S00346ED1V01Y2... [2] http://www.cl.cam.ac.uk/~pes20/weakmemory/index.html http://www.cl.cam.ac.uk/~pes20/weakmemory/index.html
- DiabloD3 12y agoDoes any of this apply on modern x86?
- adamnemecek 12y agoYou mean compared with the 'ancient' x86 from 2009?
- DiabloD3 12y agoYes. Intel has done a surprisingly large amount of optimization in their CPUs over the past few years.
- adamnemecek 12y agoSure but there is no way that memory ordering would have been impacted by any of those.
- colanderman 12y agoSee also the Linux Kernel documentation on memory barriers in general: https://www.kernel.org/doc/Documentation/memory-barriers.txt https://www.kernel.org/doc/Documentation/memory-barriers.txt