RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v5]
Stefan Karlsson
stefank at openjdk.org
Thu Oct 23 05:17:02 UTC 2025
On Wed, 22 Oct 2025 20:06:42 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> I don't know if I've said it here or only offline, so I post it here. I would have preferred if this patch retained the names from `AtomicAccess`. I don't think it would be problematic to understand that `var.xchg()` requires you to understand what `var` is. And if you know that `var` is an `Atomic` then you know what `var` is then this is no more confusing than a call to `AtomicAccess::xchg`. The same for `inc` and `dec`.
>
> Obviously, I disagree. I think using those names would be strictly (and
> noticeably) worse that what is currently proposed, and have explained why I
> think that.
Of course. I brought this up to show that one person has so far said that xchg is a bad name and two has said that they prefer to keep it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27539#discussion_r2453941344
More information about the hotspot-dev
mailing list