RFR: 8374190: Convert ConcurrentHashTable atomic lists to use Atomic<T> [v2]

Kim Barrett kbarrett at openjdk.org
Tue Jan 6 17:11:58 UTC 2026


On Tue, 6 Jan 2026 01:36:14 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> The `const` is still relevant, for the reason described. It's at least
>> arguable that it's kind of sketchy to do this. It certainly took me a bit of
>> study to understand. Note that I moved the position of the `const` qualifier
>> to its more usual location (in our code) for declaring a constant object (the
>> `Atomic<Node*>` is atomic). It could instead be written as `Atomic<Node*> const*`,
>> retaining the ordering from the original. Also see the implementation, where
>> we need to cast away the `const` qualifier, which is now being done with
>> `const_cast` rather than a C-style cast (that was also stripping off the `volatile`
>> qualifier, which the use of `AtomicAccess` implicitly reapplied).
>
> Okay. The comment would make more sense, IMO, on the implementation, rather than the declaration.

That part of the comment is explaining a weirdness in the signature, so there is some justification
for being in the header.  Coming up with a different protocol that doesn't have that weirdness might
be better, but far out of scope for this change.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28951#discussion_r2665626839


More information about the hotspot-dev mailing list