Which is a better write barrier on x86: lock+addl or xchgl?

Quoting from the IA32 manuals (Vol 3A, Chapter 8.2: Memory Ordering): In a single-processor system for memory regions defined as write-back cacheable, the memory-ordering model respects the following principles [..] Reads are not reordered with other reads Writes are not reordered with older reads Writes to memory are not reordered with other writes, with the … Read more