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

Remove mixed-size accesses to the LockWord

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 9
    • hotspot

      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.

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

              Created:
              Updated:
              Resolved: