RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v5]

Kim Barrett kbarrett at openjdk.org
Fri Oct 24 15:00:36 UTC 2025


On Wed, 22 Oct 2025 14:22:49 GMT, Kim Barrett <kbarrett 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 intended to say that `AtomicAccess` doesn't support 16 bit RMW operations on any platform.
It does support load/store on at least some platforms, but that may be because it would take effort to not do so.

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

PR Comment: https://git.openjdk.org/jdk/pull/27539#issuecomment-3443605135


More information about the hotspot-dev mailing list