Refactor the TaskTerminator

XMLWordPrintable

    • gc
    • b12

      The JVM's task terminator is a complicated piece of code that is very hard to follow.

      - many levels of conditional code, two nested infinite loops which are exit at several places, and use of non-scoped locking.
      - the algorithm is spread and partially duplicated across two methods (offer_termination() and do_spin_master_work()), one calling the other.

      By separating the spinning code (currently in do_spin_master_work()) and the termination condition checking currently distributed across both methods the code can be simplified significantly, and duplicate code eliminated.

      Initial tests with a prototype of this change showed no performance regressions, but more performance testing is needed.

            Assignee:
            Thomas Schatzl
            Reporter:
            Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: