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

Remove mixed-size accesses to the LockWord

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: hotspot

      Description

      The Lockword in the Mutex/Monitor encodes various bits of information and is usually updated via a full-word atomic CAS. However, an optimization in the unlock path was implemented years ago for sparc/x86 using a non-atomic byte-store of zero into the LSB to clear the lock. It is not clear if architectures other than sparc/x86 guarantee the safety of such mixed accesses and it is suggested to simply replace the store of zero with an atomic decrement.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dholmes David Holmes
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: