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

Small ObjectMonitor spinning code cleanups

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • None
    • hotspot
    • b20

      Add some functions and move down the Knobs for adaptive spinning in order to do more experiments on the heuristics.

      TrySpin should return a boolean.
      TryLock returns either -1, 0, or 1 depending on whether the CAS is attempted or another owner is found. The caller in spinning can use this value to see if a CAS fails, to stop spinning, even in the short spin.

      Some benchmarks like Dacapo pmd show a 22% improvement with just a fixed spin of 2000. pmd waits on the ClassLoader lock, but briefly after the classes are loaded. Rearrange the code to make prototyping easier.

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: