Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8080106 Refactor setup of parallel GC threads
  3. JDK-8080109

Use single-threaded code in Threads::possibly_parallel_oops_do when running with only one worker thread

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • hotspot
    • None
    • gc
    • b68

        Today, the root processing code differentiates between two types of single-threaded executions:

        1) n_par_threads() == 0, used from Serial GC and other code paths that executes the root processing from the VM Thread.
        2) n_par_threads() == 1, used from non-Serial GCs when the root_processing is executed by one GC worker thread.

        Today, the only code difference is that the latter will use cmpxchg to claim the threads in Threads::possibly_parallel_oops_do.

        I propose that we use the same code for both values of n_par_threads(), and only use the cmpxchg version if we are running with more than one worker thread.

        This change will enable further cleanups and unification of the code for other sub-tasks of JDK-8080106.

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

                Created:
                Updated:
                Resolved: