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

Add Mutex::try_lock version without rank checks

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b26

      Description

      The mutex ranking is used as a deadlock prevention technique that assigns a rank to each Mutex. Mutexes have to be acquired in order of decreasing rank which prevents circular waits. Today we validate this order everytime we acquire ownership of a Mutex. We could relax this validation for try_lock() in cases where failure to acquire ownership will not block the thread's progress, i.e. in cases where the action under the lock is desirable but can be skipped on try_lock() failure. In these cases, even if the Mutex is out of rank order the thread will not block if it already has an owner, so circular waits are not possible.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pchilanomate Patricio Chilano Mateo
              Reporter:
              pchilanomate Patricio Chilano Mateo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: