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
A guest which invokes that hostcall in a loop, like the upstream-async test fixture, may not give Tokio any other opportunities to do I/O. Viceroy currently addresses that by using Wasmtime's "fuel" mechanism to interrupt the loop periodically, but in between those interruptions the loop spins without any way to make progress.
Note that Tokio's implementation of yield_now is very similar to Wasmtime's implementation of an async yield in response to either fuel-based or epoch interruption: both return Pending on the first poll and Ready on the second.
So I think yielding in pending_req_poll will tend to reduce both latency and CPU usage. In addition I think it means the upstream-async test would pass without either fuel-based or epoch interruptions, although there may be other situations which still require those interruptions in order to make progress.
The text was updated successfully, but these errors were encountered:
I think
pending_req_poll
should calltokio::task::yield_now
before returning when the request is not ready.A guest which invokes that hostcall in a loop, like the upstream-async test fixture, may not give Tokio any other opportunities to do I/O. Viceroy currently addresses that by using Wasmtime's "fuel" mechanism to interrupt the loop periodically, but in between those interruptions the loop spins without any way to make progress.
Note that Tokio's implementation of
yield_now
is very similar to Wasmtime's implementation of an async yield in response to either fuel-based or epoch interruption: both returnPending
on the first poll andReady
on the second.So I think yielding in
pending_req_poll
will tend to reduce both latency and CPU usage. In addition I think it means the upstream-async test would pass without either fuel-based or epoch interruptions, although there may be other situations which still require those interruptions in order to make progress.The text was updated successfully, but these errors were encountered: