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

Improve Exchanger performance with VirtualThreads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • core-libs
    • None

      The Exchanger class uses spin-waits that are hostile to some uses of VirtualThreads. Improving this requires a means of estimating whether there are many VirtualThreads with few carriers, which can be supported by adding a method in class ForkJoinWorkerThread. This enables a reworking of the exchange method, and can also be used to deal with similar issues (for example LinkedTransferQueue). We leave for now open whether this method (hasKnownQueuedWork) should be public, which would allow users to use it in similar contexts, at the possible expense of revealing too much about current VT implementation.

            dl Doug Lea
            dl Doug Lea
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: