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

Use semaphores when starting and stopping GC task threads

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • None
    • gc
    • b81

        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.

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

                Created:
                Updated:
                Resolved: