Replace MemBarRelease for final field write with MemBarStoreStore

Doug Lea dl at cs.oswego.edu
Wed Sep 2 15:21:53 UTC 2015


On 09/02/2015 11:08 AM, Vitaly Davidovich wrote:
>
> I'm not sure "accommodating" capturing racy memory is required
> here.
>
> Hans' actual example isn't applicable to final/stable fields because they cannot
> be mutated after assignment.  You introduced a racy read in your example, and I
> don't know if that's valid.

The existing JSR133 JMM specs and final field rules do not provide an answer.
And the JMM will not be updated for jdk9. For VarHandle usages, we
can specify what happens when you use them (thus resolving the issue
in those cases). But for other usages, the answer is murky, and
most people think that reducing surprise is the best decision.

-Doug




More information about the hotspot-compiler-dev mailing list