By: NoSpammer (no.delete@this.spam.com), July 13, 2015 11:34 am
Room: Moderated Discussions
EduardoS (no.delete@this.spam.com) on July 12, 2015 6:47 pm wrote:
> Good argument, everyone life's would be easier if a variable read means "get the
> absolutely most up-to-date value of this memory location", but if it was the case
> x86 memory ordering would also be broken too and needs a lot of barriers.
With x86 a volatile variable is at least up to date monotonically with respect to what you've seen so far. That's actually good enough and it's excellent for producer-consumer type of stuff.
> Good argument, everyone life's would be easier if a variable read means "get the
> absolutely most up-to-date value of this memory location", but if it was the case
> x86 memory ordering would also be broken too and needs a lot of barriers.
With x86 a volatile variable is at least up to date monotonically with respect to what you've seen so far. That's actually good enough and it's excellent for producer-consumer type of stuff.