-
Enhancement
-
Resolution: Fixed
-
P4
-
15
-
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.
- 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.
- relates to
-
JDK-8251833 Investigate TaskTerminator improvements
- Open