You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tokio uses cooperative task yielding to improve tail latencies in the circumstance that a resource polled in a loop fails to yield, leading to starvation of other tasks. Something similar could be set up for async-io as well.
The Reactor already has a concept of "ticks", which are used to coordinate polling. My idea would be that each Source keeps track of the tick which it last returned Poll::Pending. If it compares tick and this theoretical last_pending_tick value and finds that the difference between the two is a large value (say, 10_000, but this could use some tweaking), pooling the Source automatically returns Pending.
Any thoughts on this? This could be a global counter as well, or maybe a thread-local one.
I would be willing to implement this if the functionality is desired.
The text was updated successfully, but these errors were encountered:
I don't know the exact reason, but the tokio's cooperative scheduling had compatibility issues with various primitives in futures and tokio that do not participate in the cooperative scheduling. (maybe a popular one is this case, finally fixed by rust-lang/futures-rs#2551) I guess there may have been a similar problem.
tokio
uses cooperative task yielding to improve tail latencies in the circumstance that a resource polled in a loop fails to yield, leading to starvation of other tasks. Something similar could be set up forasync-io
as well.The
Reactor
already has a concept of "ticks", which are used to coordinate polling. My idea would be that eachSource
keeps track of the tick which it last returnedPoll::Pending
. If it comparestick
and this theoreticallast_pending_tick
value and finds that the difference between the two is a large value (say,10_000
, but this could use some tweaking), pooling theSource
automatically returnsPending
.Any thoughts on this? This could be a global counter as well, or maybe a thread-local one.
I would be willing to implement this if the functionality is desired.
The text was updated successfully, but these errors were encountered: