Stream: git-wasmtime

Topic: wasmtime / PR #8429 Allow sleep form of poll_oneoff for w...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 09:48):

daichifukui opened PR #8429 from daichifukui:realtime-improvement to bytecodealliance:main:

Allow sleep form of poll_oneoff for wasmtime-wasi crate, which just sleeps for relative time using sleep from the std::thread. This patch derives from the commit "Support sleep forms of poll_oneoff" 6b40724d18a144a0f781b7b907a13be885713f1f. Applying this patch would help improve the real-time performance of wasmtime.

Closes #8428

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 09:48):

daichifukui requested wasmtime-core-reviewers for a review on PR #8429.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 09:48):

daichifukui requested alexcrichton for a review on PR #8429.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 14:40):

alexcrichton submitted PR review:

Thanks! I've got a comment about needing to handle allow_blocking_current_thread since by default the current thread should not be blocked, but otherwise looks good to me.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 14:40):

alexcrichton submitted PR review:

Thanks! I've got a comment about needing to handle allow_blocking_current_thread since by default the current thread should not be blocked, but otherwise looks good to me.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 14:40):

alexcrichton created PR review comment:

Can this use self.ctx().allow_blocking_current_thread to dispatch on whether to call std::thread::sleep or do an async tokio-based sleep?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 19:38):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2024 at 19:38):

pchickey created PR review comment:

Can you please leave a comment here describing why this special case exists - specifically that it was experimentally determined to result in more consistent sleep times as required for real-time use cases?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 05:01):

daichifukui updated PR #8429.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 05:05):

daichifukui submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 05:05):

daichifukui created PR review comment:

Hi @pchickey ,

Yes, I added a comment for more explanation. Hopefully that helps us understand this special case.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 05:14):

daichifukui submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 05:14):

daichifukui created PR review comment:

Hi @alexcrichton ,
Yes, we can use it. Take a look at the updated change. If self.ctx().allow_blocking_current_thread is false, we just skip calling std::thread::sleep, and then do the rest of poll_oneoff to do an async tokio-based sleep.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 15:38):

alexcrichton updated PR #8429.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 15:38):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 15:38):

alexcrichton has enabled auto merge for PR #8429.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 16:25):

alexcrichton merged PR #8429.


Last updated: Nov 22 2024 at 17:03 UTC