Unless I've missed some follow-up decision, the intent has always been
to only guarantee atomicity under opaque-or-stronger mode. Although
perhaps something could be said about only extracting one primitive
field from a compound value.
On 8/2/21 11:45 AM, Brian Goetz wrote:
From the -comments list.
-------- Forwarded Message --------
Subject: Primitive objects vs memory model
Date: Mon, 2 Aug 2021 16:55:50 +0200
From: Raffaello Giulietti <raffaello.giulie...@gmail.com>
To: valhalla-spec-comme...@openjdk.java.net
Hello,
I'm wondering if the relationship between primitive objects and the
memory model (JLS 17 and j.l.i.VarHandle) has been discussed before. I
couldn't find aything in JEP 401, nor is the mailing list archive,
spanning more than 5 years of intense discussions, easily searchable
for keywords.
For example, does plain access mode guarantee bitwise atomicity (aka
access atomicity) on JEP 401 Point instances (2 double fields for the
coords), as if they were 32 bit values? Or perhaps only opaque mode
can make such guarantees?
Greetings
Raffaello