JDK-8371923 : Update LockFreeStack for Atomic
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-11-14
  • Updated: 2025-11-24
  • Resolved: 2025-11-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b25Fixed
Related Reports
Blocks :  
Blocks :  
Description
LockFreeStack has a _top member that should be converted to use Atomic<T> instead of volatile.

LockFreeStack also requires the element type provide a "next" member for use by the linked-list representation of the stack. An element type provides LockFreeStack with access to this member through a function that is a template parameter of LockFreeStack.

Currently that function is required to return a volatile pointer and LockFreeStack uses AtomicAccess to manipulate it. With the advent of Atomic<T> we want it to instead use that API. But in the interest of not requiring all clients to convert to Atomic<T> simultaneously, LockFreeStack should, for now, support both forms, selected by the signature of the "next" access function.

Comments
Changeset: 6f1c5733 Branch: master Author: Kim Barrett <kbarrett@openjdk.org> Date: 2025-11-19 20:05:09 +0000 URL: https://git.openjdk.org/jdk/commit/6f1c5733ed4a1d1a1e099681f1f292acf827d9dc
19-11-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28329 Date: 2025-11-14 18:35:10 +0000
14-11-2025