RFR: 8338142: (dc) DatagramChannelImpl.blockingReceive can use untimed-park when no timeout set

Alan Bateman alanb at openjdk.org
Tue Aug 13 10:31:57 UTC 2024


When no timeout is set, DatagramSocket.receive on a virtual thread is currently implemented as a timed receive and a timeout of Long.MAX_VALUE. This came about when this code was changed to avoid pinning issues when calling this method on a virtual thread. It would be better to use an untimed-park for this case, and this would also avoid a long standing issue with overflow in STPE (JDK-8338104).

All tests in tier2 (which has the tests for this API) are passing on all platforms. I don't propose to add further tests at this time.

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

Commit messages:
 - Merge
 - Merge
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/20565/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20565&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338142
  Stats: 13 lines in 1 file changed: 7 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20565.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20565/head:pull/20565

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


More information about the nio-dev mailing list