RFR: 8344328: (dc) DatagramChannelImpl.blockingReceive can now synchronize on packet

Daniel Fuchs dfuchs at openjdk.org
Tue Nov 19 14:24:44 UTC 2024


On Mon, 18 Nov 2024 16:17:20 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Now that JEP 491 is integrated, we can restore long-standing behavior in the DatagramSocket adaptor to synchronize on the DatagramPacket for the duration of the send/receive.

Given that anyone can synchronize on DatagramPacket, would it be better to synchronize on `p` in the DatagramSocketAdaptor, before obtaining the readLock/writeLock, in order to reduce the chances of potentially triggering a deadlock?

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

PR Review: https://git.openjdk.org/jdk/pull/22212#pullrequestreview-2445626033


More information about the nio-dev mailing list