Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319447 Improve performance of delayed task handling
  3. JDK-8362881

Release Note: Updates to ForkJoinPool and CompletableFuture

XMLWordPrintable

      `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.

            Unassigned Unassigned
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: