Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315131

Clarify VarHandle set/get access on 32-bit platforms

XMLWordPrintable

        The VarHandle methods on MethodHandles, byteArrayViewVarHandle, byteBufferViewVarHandle state:

             * If access is aligned then following access modes are supported and are
             * guaranteed to support atomic access:
             * <ul>
             * <li>read write access modes for all {@code T}, with the exception of
             * access modes {@code get} and {@code set} for {@code long} and
             * {@code double} on 32-bit platforms.

        This is misleading, aligned access for modes get/set is supported on 32-bit systems but access is not guaranteed to be atomic and therefore may lead to word tearing.

        Note: This is already fixed in MemoryLayout::varHandle.

              liach Chen Liang
              psandoz Paul Sandoz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: