RFR: 8371923: Update LockFreeStack for Atomic<T>
Ivan Walulya
iwalulya at openjdk.org
Tue Nov 18 09:20:44 UTC 2025
On Fri, 14 Nov 2025 18:35:10 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change to the `LockFreeStack` utility to allow clients to
> use `Atomic<T>` as the type of the "next" member used in the linked-list
> representation of the stack. It also continues to allow clients to use the old
> (pre-`Atomic<T>`) form where the "next" member is volatile. This allows
> clients to be updated incrementally after this change, rather than requiring
> all clients to be updated in conjunction with the update of this class. Once
> all clients have been updated, support for the old form can be removed.
>
> The associated gtests have been updated to use `Atomic<T>`, with testing of
> the old form is no longer being done. The non-updated uses provide some
> testing, and that's all expected to go away soon. So parameterizing the gtests
> for both forms seems like a bunch of work that will just be deleted soon, with
> very little benefit.
>
> Testing: mach5 tier1
Nit!
src/hotspot/share/utilities/lockFreeStack.hpp line 59:
> 57: // \tparam T is the class of the elements in the stack.
> 58: //
> 59: // \tparam next_access is a function pointer. Applying this function to
Maybe `next_accessor`? I found reading `next_access` difficult because it’s unclear whether it’s meant as a verb (i.e., “access next”) or a noun (i.e., “next access”).
-------------
Marked as reviewed by iwalulya (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28329#pullrequestreview-3476385407
PR Review Comment: https://git.openjdk.org/jdk/pull/28329#discussion_r2537029019
More information about the hotspot-dev
mailing list