JDK-8363552 : Update SubmissionPublisher() specification to reflect use of ForkJoinPool.asyncCommonPool()
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 25,26
  • Submitted: 2025-07-22
  • Updated: 2025-08-05
  • Resolved: 2025-07-24
Related Reports
CSR :  
Description
Summary
-------

Update the `java.util.concurrent.SubmissionPublisher` no-arg constructor to document that it does not special case parallelism < 2.

Problem
-------

The changes in JDK-8319447 to improve the performance of delayed task handling updated `CompletableFuture` and `SubmissionPublisher` to use the ForkJoinPool commonPool in all cases. These APIs previously created a Thread for each task when parallelism was less than 2.  We missed the update to SubmissionPublisher no-arg constructor in that update.


Solution
--------

Update SubmissionPublisher's no-arg constructor to specify that it uses the ForkJoinPool.commonPool in all cases.


Specification
-------------

```
     /**
      * Creates a new SubmissionPublisher using the {@link
-     * ForkJoinPool#commonPool()} for async delivery to subscribers
-     * (unless it does not support a parallelism level of at least two,
-     * in which case, a new Thread is created to run each task), with
+     * ForkJoinPool#commonPool()} for async delivery to subscribers, with
      * maximum buffer capacity of {@link Flow#defaultBufferSize}, and no
      * handler for Subscriber exceptions in method {@link
      * Flow.Subscriber#onNext(Object) onNext}.
```


Comments
Moving to Approved.
24-07-2025

The updated specification matches the implementation in the constructor and looks good to me.
23-07-2025