-
Sub-task
-
Resolution: Delivered
-
P4
-
25
`java.util.concurrent.ForkJoinPool` is updated in this release to implement `ScheduledExecutorService`. This API update can help the performance of delayed task handling in network and other applications where delayed tasks are used for timeout handling, and where most timeouts are cancelled.
In addition to the `schedule` methods defined by `ScheduledExecutorService`, `ForkJoinPool` now defines a new method `submitWithTimeout` to submit a task that is cancelled (or some other action executed) if the timeout expires before the task completes.
As part of the update, `CompletableFuture` and `SubmissionPublisher` are changed so that all async methods without an explicit `Executor` are performed using the `ForkJoinPool` common pool. This differs to previous releases where a new thread was created for each async task when the `ForkJoinPool` common pool was configured with parallelism less than 2.
In addition to the `schedule` methods defined by `ScheduledExecutorService`, `ForkJoinPool` now defines a new method `submitWithTimeout` to submit a task that is cancelled (or some other action executed) if the timeout expires before the task completes.
As part of the update, `CompletableFuture` and `SubmissionPublisher` are changed so that all async methods without an explicit `Executor` are performed using the `ForkJoinPool` common pool. This differs to previous releases where a new thread was created for each async task when the `ForkJoinPool` common pool was configured with parallelism less than 2.