Re: Are there real use cases with the Java access modes?

Andrew Haley via Concurrency-interest <[email protected]> Mon, 19 Jul 2021 15:25:25 +0100
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
On 7/19/21 3:06 PM, Gregg Wonderly via Concurrency-interest wrote:
> I am specifically against the single optimization I illustrated that rewrites code to be non-logically executed, without the user being aware of this happening and not being warned that an optimization has potentially made the logic of the application not work as expected.

That single optimization is no more than hoisting a memory load. It's
one of the most common optimizations there is. It probably happens
many times in every moderately complex method. It's not some kind of
weird "let's turn this into an infinite loop" optimization.

For every non-volatile field load, in the absence of synchronization
actions, it is entirely correct and proper to hoist the result of that
load into a register, or propagate its value some other way. This is
common in many programming language implementations, and is not going
to change. It is a very important optimization.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest