News for hackers. Stuff that matters.
Re:No sane compiler would optimize atomics (2015) by chrisseaton on Sunday July 11, 2021 @08:25PM (#27805672)
Isn't this already expressible with something like a yield statement between the two atomics?

If you need it - write it down! I can't guess your intentions as a compiler author!

Re:No sane compiler would optimize atomics (2015) by Dylan16807 on Sunday July 11, 2021 @10:49PM (#27806417)
A yield might be way too slow.

And sure, there should be a way to signal intentions. By my point is that there is a reasonable way to describe what certain people would expect by default.

Re:No sane compiler would optimize atomics (2015) by spacechild1 on Monday July 12, 2021 @05:30AM (#27808550)
“volatile std::atomic“ also works and is more clear, IMO.