Live data from Hacker News

Memory Models: A Case for Rethinking Parallel Languages and Hardware (2010)

cacm.acm.org

11–12 of 12 posts

Re: Memory Models: A Case for Rethinking Parallel Languages and Hardware (2010)

#11
post #8

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…

Imagine 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.

Re: Memory Models: A Case for Rethinking Parallel Languages and Hardware (2010)

#12
post #8

Earlier quoted context omitted.

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…

Imagine 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.

Thanks!
Post reply on HN