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

Unsafe Documentation around Barrier Methods Inaccurate

XMLWordPrintable

    • b14
    • generic
    • generic
    • Not verified

      When reviewing some of the documentation in jdk.internal.misc.Unsafe, it appears that there is some dated information regarding the availability of "pure barrier" methods (i.e. pure StoreStoreFence sans a LoadStore barrier). When the storeFence() and loadFence() methods were implemented the pure variations (loadLoadFence(), storeStoreFence()) were not implemented and the documentation indicated as much. This is no longer the case.

      I've included a patch with this email that updates the docs to reflect the new state of affairs here as well as indicate some implementation details as to how the pure variants utilize the impure original methods.

      The parts of the documentation in the sentence on
      - https://github.com/openjdk/jdk/blob/d7ca08a5cc64c8d3941493d98423a49b5bc1b922/src/java.base/share/classes/jdk/internal/misc/Unsafe.java#L3415
      - https://github.com/openjdk/jdk/blob/d7ca08a5cc64c8d3941493d98423a49b5bc1b922/src/java.base/share/classes/jdk/internal/misc/Unsafe.java#L3400

      No longer as such methods do exist in Unsafe now.

      Additionally documentation clarifying Java version since info and implementation details should be added to the "pure" barrier methods.

      - https://github.com/openjdk/jdk/blob/d7ca08a5cc64c8d3941493d98423a49b5bc1b922/src/java.base/share/classes/jdk/internal/misc/Unsafe.java#L3444
      - https://github.com/openjdk/jdk/blob/d7ca08a5cc64c8d3941493d98423a49b5bc1b922/src/java.base/share/classes/jdk/internal/misc/Unsafe.java#L3436

            igraves Ian Graves
            igraves Ian Graves
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: