On Mon, 12 Aug 2024 17:07:42 GMT, Doug Lea <d...@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

The only applicable tests here are performance tests. I have several ad-hoc 
ones, but I'm not sure how useful they would be to place in openjdk repo. 
However, it occurred to me that sometime soon, a version of the whole j.u.c tck 
suite should be created to use virtual threads. Which would not be  easy, but 
might uncover something surprising?

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

PR Comment: https://git.openjdk.org/jdk/pull/20554#issuecomment-2299609454

Reply via email to