RFR: 8360046: Scalability issue when submitting virtual threads with almost empty tasks [v5]

He-Pin (kerr) duke at openjdk.org
Wed Aug 27 05:35:49 UTC 2025


On Tue, 12 Aug 2025 07:50:20 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Ah, this is about getting a `AdaptedRunnableAction` rather than a `RunnableExecuteAction` (where the latter is an InterruptibleTask, and the former isn't). Sounds worth of a comment here?
>
> Yes, it means we always adapt before calling submit, lazySubmit and externalSubmit rather than the mix of execute(Runnable) and xxxSubmit.

If it's already a `AdaptedRunnable` should we adapt it too? if not, can we change the `ForkJoinTask.adapt` to something :

    public static ForkJoinTask<?> adapt(Runnable runnable) {
        if (runnable instanceOf AdaptedRunnableAction action) 
            return action
         else   return new AdaptedRunnableAction(runnable);
    }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26479#discussion_r2302872190


More information about the core-libs-dev mailing list