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

Alan Bateman alanb at openjdk.org
Tue Aug 13 16:08:54 UTC 2024


On Tue, 13 Aug 2024 10:22:58 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 58b95705
Author:    Alan Bateman <alanb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/58b957054437edee7d0abc365133985ac30a6af4
Stats:     13 lines in 1 file changed: 7 ins; 2 del; 4 mod

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

Reviewed-by: dfuchs

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

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


More information about the nio-dev mailing list