Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8363552

Update SubmissionPublisher() specification to reflect use of ForkJoinPool.asyncCommonPool()

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 25, 26
    • core-libs
    • None
    • minimal
    • Docs only change
    • Java API
    • SE

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

            alanb Alan Bateman
            kganapureddy Krushnareddy Ganapureddy
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: