RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations
David Holmes
dholmes at openjdk.org
Tue Sep 30 06:51:49 UTC 2025
On Mon, 29 Sep 2025 12:06:04 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> I've always thought it's weird that for most AtomicAccess operations, the short form (defaulted memory order) provides the strongest ordering, but the short form of load/store is the weakest form.
Atomic r-m-w operations (pretty much everything except base load/store) were required to have full bi-directional fence semantics from "day one". That doesn't make sense for base load/store so they are "relaxed" by default. I personally hate the term "relaxed" as it suggests to me a removal of "normal" ordering, when really it means the absence of a stronger ordering.
Naming is hard and very subjective. I agree with @stefank about `relaxed_store` and `release_store` being similar enough that you have to stop and make sure you read it correctly. I don't have an issue with dropping `relaxed` from the names. I'm also not going to fight for its removal.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27539#issuecomment-3350228979
More information about the hotspot-dev
mailing list