Earlier quoted context omitted.
Unfortunately because of compiler optimizations, memory models are important even on uniprocessors.
Sure, and the article discusses that. I was thinking at the instruction level. I tend to think of convincing the hardware to do what you want and convincing the compiler to do what you want separately as an effect of writing code before the languages had specified memory models. EDIT: Though as I think about it I'm having a hard time thinking of a system in which those compiler optimizations are problematic on a unip…
Re: Memory Models: A Case for Rethinking Parallel Languages and Hardware (2010)
#11Imagine implementing a simple spinlock, but then substituting relaxed atomics for acquire/release synchronization. The compiler can reorder taking the lock relative to the protected operations and render the lock useless.