JDK-8307926 : Support byte-sized atomic bitset operations
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-11
  • Updated: 2024-01-02
  • Resolved: 2023-05-13
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 17 JDK 21
17.0.11Fixed 21 b23Fixed
Related Reports
Relates :  
Description
JDK-8293117 added Atomic bitset operations for int-sized and (if different) pointer-sized values. But there are existing use-cases in HotSpot that need to operate on byte-sized values.  So we need to add support for such.

Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2061 Date: 2023-12-19 11:32:52 +0000
19-12-2023

[jdk17u-fix-request] Approval Request from Aleksey Shipilëv Clean backport to improve Atomic support in JDK 17 and align it with mainline JDKs, simplifying future backports. Note the patch basically adds documentation that byte-level support is available, and adds a few tests. Therefore, there is no direct product impact.
19-12-2023

Changeset: 646747fd Author: Kim Barrett <kbarrett@openjdk.org> Date: 2023-05-13 23:03:06 +0000 URL: https://git.openjdk.org/jdk/commit/646747fd7c7320910eed682ae6da3cd4c60a51a5
13-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13952 Date: 2023-05-12 09:57:44 +0000
12-05-2023

[~dholmes] Many hardware platforms don't support byte-sized atomic bitops, so yes, we'll need to do something like we did to support cmpxchg with byte-sized values, e.g. CmpxchgByteUsingInt. Of course, the default (and currently only) implementation of these operations uses cmpxchg, so accidentally happen to work on byte-sized values already. But we need to make that "official" and make sure future platform specializations handle it (possibly by continuing to use cmpxchg and CmpxchgByteUsingInt).
12-05-2023

Does the hardware support byte atomic operations? Otherwise we will need to use the cas-loop trick on the entire word (which will need to be suitably aligned).
12-05-2023