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

Use semaphores when starting and stopping GC task threads

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b81

      Backports

        Description

        The current implementation to distribute tasks to GC worker threads often cause long latencies when the threads are started stopped.

        The main reason is that the worker threads have to fight over the Mutex when they are woken up from the call to Mutex::wait. Another reason is that all worker threads call notify_all when then finish the task, and effectivly waking all sleeping threads, which will yet again force the worker threads to fight over the Mutex.

        I propose that we use semaphores instead, so that the worker threads don't have to fight over a lock when they are woken up.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  stefank Stefan Karlsson
                  Reporter:
                  stefank Stefan Karlsson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: