RFR: 8318422: Allow poller threads be virtual threads [v2]

Alan Bateman alanb at openjdk.org
Fri Nov 3 14:01:36 UTC 2023


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16243/files
  - new: https://git.openjdk.org/jdk/pull/16243/files/9588be88..87136dde

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16243&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16243&range=00-01

  Stats: 6428 lines in 139 files changed: 1949 ins; 2117 del; 2362 mod
  Patch: https://git.openjdk.org/jdk/pull/16243.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16243/head:pull/16243

PR: https://git.openjdk.org/jdk/pull/16243


More information about the nio-dev mailing list