On Thu, 2 Jul 2026 14:43:06 GMT, Doug Lea <[email protected]> wrote:

>> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3290:
>> 
>>> 3288:      */
>>> 3289:     public <T> ForkJoinTask<T> lazySubmit(ForkJoinTask<T> task) {
>>> 3290:         return poolSubmit(false,  Objects.requireNonNull(task));
>> 
>> @DougLea Worth noting is that with this commit, all calls to poolSubmit now 
>> has a `true` signalIfEmpty.
>
> Thanks! Assuming we keep new lazySubmit (seems no reason not to), I'll 
> simplify

The virtual thread implementation uses lazySubmit to push to the local queue 
without signalling. The usage is to continue a virtual thread with the current 
FJWT as the carrier, and is only invoked in the context of a FJWT when its 
queue is empty.

We did some experiments with a randomExternalSubmit some time ago for use when 
starting new virtual threads or in the yield implementation. Need to repeat 
those experiments to see if there is merit to exposing a new method.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r3736352703

Reply via email to