does the underlying implementation (not public) of DatagramSocketImp's send receive method busy wait
Paul Marks
pmarks at google.com
Mon Dec 18 21:24:28 UTC 2017
On Thu, Dec 14, 2017 at 9:54 AM, Andy Nuss <andrew_nuss at yahoo.com> wrote:
> busy looping on a flag of the UDP protocol?
>
I believe it's just a blocking sendto():
https://github.com/netroby/jdk9-dev/blob/master/jdk/src/java.base/linux/native/libnet/linux_close.c#L393
So if the kernel decides to block, the thread will be suspended (consuming
no CPU) until it's done.
However, the UDP protocol has no concept of flow control, so blasting out
packets without any rate limit or acknowledgement mechanism is not a good
idea. If you saturate a link in the network, sendto() is not obligated to
block, or provide any feedback whatsoever.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20171218/3892dac0/attachment.html>
More information about the net-dev
mailing list