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

Simplify G1ServiceThread

    XMLWordPrintable

    Details

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

      Description

      G1ServiceThread::schedule_task calls schedule (locking the monitor), then calls notify (relocking the monitor) to trigger updating any pending wait. It would be simpler if schedule had a bool notify argument for use there (true) and by G1ServiceTask::schedule (false, since called from the service thread, so it can't be waiting). This would make the notify() function only called from stop_service, which could just do the monitor lock and notify directly, eliminating the notify function.

      The thread's service loop is also more complicated than it needs to be, with multiple trips in and out of the monitor. This can also be simplified and made to look more like typical wait-for-value then process loops.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: