RFR: 8318422: Allow poller threads be virtual threads [v2]
Michael McMahon
michaelm at openjdk.org
Fri Nov 3 15:05:05 UTC 2023
On Fri, 3 Nov 2023 14:01:36 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Virtual threads doing blocking I/O rely on poller threads to unpark virtual threads when sockets are ready for I/O. Right now, the poller threads are dedicated platform threads that block waiting for I/O events. In some environments it would be better to have the poller thread be virtual threads so that handling of I/O events integrates better with the virtual thread scheduler and doesn't steal cycles from the carrier threads.
>>
>> The changes to support this are straight forward but it has required refactoring the internal Poller class so the changes might look more than they actually are. The changes mean the Poller implementation supports two modes. The default is changed on Linux to use the "virtual thread poller" mode. The default on other platforms is to use platform threads as before. As part of the refactor, the so-called "indirect" mode with updater threads is removed. This mode came from experimenting in the loom repo a long time ago and probably should have been removed before integration.
>
> Alan Bateman 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 six additional commits since the last revision:
>
> - VMOutOfMemoryException001.java should be excluded on all platforms
> - Merge
> - Sync up changes from loom repo
> - Merge
> - Merge
> - Initial commit
Latest change is good.
-------------
Marked as reviewed by michaelm (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16243#pullrequestreview-1712913029
More information about the nio-dev
mailing list