Replies: 1 comment 5 replies
-
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I am using udp_socket to send() and recv() over the same udp socket from different tokio tasks.
https://github.com/mxinden/udp-socket
Such library relies on poll_readable / poll_writable functions.
https://github.com/mxinden/udp-socket/blob/master/src/socket.rs#L71
In my case sends are very slow (~200 ms) and I think its because the recv() task is somehow starving the send task, probably because of this lock https://github.com/smol-rs/async-io/blob/master/src/reactor.rs#L440
I have rewrote the two send() and recv() functions to use the newer .readable() .writable() functions to await readiness, instead of using the poll_ versions and it's working great (sends take < 1ms). However, I fail to understand why exactly. Can somebody help me understand ?
What's the intended usage of poll_* versus .readable() / .writable() ?
What could be wrong with the original implementation ?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions