RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v5]
Kim Barrett
kbarrett at openjdk.org
Wed Oct 22 14:26:07 UTC 2025
On Wed, 22 Oct 2025 06:51:57 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> > So in the following code snippet neither `Atomic<EnumClass16>` nor `Atomic<uint16_t>` can be compiled.
>
> It seems like this is expected by the implementation (only allow Integer 32/64, or Byte 8). But it is unexpected for me that `Atomic<T>` does not support these types while AtomicAccess does. At least for loads and stores. (Or is that not true on all platforms)
I don't think `AtomicAccess` supports 16bit accesses on any platform. I also don't think `AtomicAccess` supports
8bit exchange on any platform. I wondered if I was wrong about that, but didn't find any sign of support for such.
There are some tools, like `XchgUsingCmpxchg`, that could be used to do that. Currently that's only used by some
32bit platforms to get 64bit xchg.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27539#issuecomment-3432627759
More information about the hotspot-dev
mailing list