RFR: 8338146: Improve Exchanger performance with VirtualThreads [v2]

Alan Bateman alanb at openjdk.org
Wed Aug 21 17:48:09 UTC 2024


On Wed, 21 Aug 2024 14:06:39 GMT, Doug Lea <dl at openjdk.org> wrote:

>> 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 in LinkedTransferQueue and possibly elsewhere. 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
>
> Doug Lea has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8338146
>  - Merge branch 'openjdk:master' into JDK-8338146
>  - Copyedit
>  - Address review suggestions
>  - Initial re-implementation

Tests aside, the update to Exchanger makes sense.

-------------

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20554#pullrequestreview-2251509992


More information about the core-libs-dev mailing list