News for hackers. Stuff that matters.
Re:No sane compiler would optimize atomics (2015) by chrisseaton on Sunday July 11, 2021 @10:26PM (#27806293)
> That information is moving in the wrong direction.

You set the direction not me! You asked me 'would you like some way to be informed that [the interleaving is] impossible'. Yes... and the user gives me that information through a synchronised block. If they don't tell me they want an interleaving to be impossible then why should I not make it possible? There are countless other interleavings I make impossible or possible when I do any trivial compiler task such as scheduling. Should I consult the user on all of them? I don't think you'd like all the questions you'd get!

Re:No sane compiler would optimize atomics (2015) by Retric on Monday July 12, 2021 @08:37AM (#27809607)
Informing the user isn’t about what you did, it’s about the user having some way of knowing what you did. At least compilers give you assembly code to look at, CPU’s are little better than black magic from a programmers perspective.
Re:No sane compiler would optimize atomics (2015) by chrisseaton on Monday July 12, 2021 @08:48AM (#27809674)
The user can dump the compiler output and intermediate structures if they want.

Or they could program against the spec and not worry.