<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>I answered on the PR on github. The documentation is misleading:</p>
    <blockquote>
      <p dir="auto" style="box-sizing: border-box; margin-top: 0px
        !important; margin-bottom: 16px; color: rgb(36, 41, 47);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe
        UI", "Noto Sans", Helvetica, Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
        font-size: 14px; font-style: normal; font-variant-ligatures:
        normal; font-variant-caps: normal; font-weight: 400;
        letter-spacing: normal; orphans: 2; text-align: start;
        text-indent: 0px; text-transform: none; white-space: normal;
        widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); text-decoration-thickness:
        initial; text-decoration-style: initial; text-decoration-color:
        initial;">The copypasted snippet above is misleading, you need
        to read the whole statement, so an IllegalStateException can
        only happen for unaligned access on access modes other than
        get/set (so volatile or opaque reads): "If access is misaligned
        then access for anything<span> </span><strong style="box-sizing:
          border-box; font-weight: var(--base-text-weight-semibold,
          600);">other than the get and set access modes</strong><span> </span>will
        result in an IllegalStateException.", the sentence you posted is
        about if it is atomic or not. It just says that on 32 bits,
        long/double are not atomic for normal set/get.</p>
      <p dir="auto" style="box-sizing: border-box; margin-top: 0px;
        margin-bottom: 0px !important; color: rgb(36, 41, 47);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe
        UI", "Noto Sans", Helvetica, Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
        font-size: 14px; font-style: normal; font-variant-ligatures:
        normal; font-variant-caps: normal; font-weight: 400;
        letter-spacing: normal; orphans: 2; text-align: start;
        text-indent: 0px; text-transform: none; white-space: normal;
        widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgb(255, 255, 255); text-decoration-thickness:
        initial; text-decoration-style: initial; text-decoration-color:
        initial;">P.S.: We definitely know that it works on 32 bit, the
        whole code of Lucene is full of those VarHandles :-)</p>
    </blockquote>
    <p></p>
    <div class="moz-cite-prefix">And no, it doe snot mean "get-and-set".
      Read the whole text, it is definitely correct, but if you don't
      read everything it may mislead you. So it can be improved.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Uwe</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Am 05.01.2023 um 13:31 schrieb Michael
      Kuhlmann:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8c58d801-1423-2e68-5577-c11bf0485d78@fiolino.de">The
      more I think about it, the clearer is that the first line of the
      Javadoc is contrary to the other lines:
      <br>
      <br>
      On 1/5/23 12:59, Michael Kuhlmann wrote:
      <br>
      <blockquote type="cite">* read write access modes for all T, with
        the exception of access modes get and set for long and double on
        32-bit platforms.
        <br>
      </blockquote>
      <br>
      So all read write modes will work, just if it's long or double
      then it won't work for get and for set access mode. (Or is
      getAndSet meant? But it's not called so, it's "get and set", so
      two access modes, or what?)
      <br>
      <br>
      Then the following lines state that even harder access modes will
      work also for long and double.
      <br>
      <br>
      So I think this should be labeled as "getAndSet" or at least
      "get-and-set" access mode. Currently it's very confusing.
      <br>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Uwe Schindler
<a class="moz-txt-link-abbreviated" href="mailto:uschindler@apache.org">uschindler@apache.org</a> 
ASF Member, Member of PMC and Committer of Apache Lucene and Apache Solr
Bremen, Germany
<a class="moz-txt-link-freetext" href="https://lucene.apache.org/">https://lucene.apache.org/</a>
<a class="moz-txt-link-freetext" href="https://solr.apache.org/">https://solr.apache.org/</a></pre>
  </body>
</html>