RFR: 8336707: Contention of ForkJoinPool grows when stealing works [v2]

Doug Lea dl at openjdk.org
Sat Oct 19 11:56:29 UTC 2024


On Fri, 18 Oct 2024 15:47:16 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Better disinguish need for exhaustive scans
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2006:
> 
>> 2004:                                 if ((!propagated ||
>> 2005:                                      ((j & 1) == 0) && t instanceof
>> 2006:                                      ForkJoinTask.InterruptibleTask) &&
> 
> It's probably premature, but given that all subclasses of InterruptibleTask are final, and that InterruptibleTask is abstract, it _might_ be cheaper to check `t.getClass().getSuperClass() == ForkJoinTask.InterruptibleTask.class`? 🤔

Thanks. This will probably be part of any solution, (assuming that perf on other tests improves as expected)  but requires one more idea to deal with a rare race.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21507#discussion_r1807299788


More information about the core-libs-dev mailing list