-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow blocking for realtime #4739
Merged
syrusakbary
merged 7 commits into
wasmerio:main
from
daichifukui:allow-blocking-for-realtime
May 23, 2024
Merged
Allow blocking for realtime #4739
syrusakbary
merged 7 commits into
wasmerio:main
from
daichifukui:allow-blocking-for-realtime
May 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
john-sharratt
approved these changes
May 23, 2024
@daichifukui you can use these methods to enable blocking sleeps (its off by default now) let mut ctx = WasiFunctionEnv::new();
ctx.data_mut().capabilities.threading.enable_blocking_sleep = true; or WasiEnvBuilder::capabilities/capabilities_mut |
Thanks for merging this.
|
A WasiEnv now has a flag that signifies if it's allowed to block the current thread and the flag is expected to be referenced when the current thread can be blocked for optimising the performance. In addition, the flag is set true when wasm modules are invoked via the CLI. wasmer-wasix uses a tokio runtime for many things according to wasmerio#4299, but tokio does not always bring the best performance in Wasmer as described in wasmerio#4738, hence this update. Signed-off-by: Daichi Fukui <daichi1.fukui@toshiba.co.jp>
Allow different sleep form of poll_oneoff, which just sleeps for relative time using std::thread::sleep. That form of poll_oneoff is only available if there is only one subscription and it is allowed to block the current thread, contributing to more consistent sleep times. This update would help improve the real-time performance of wasmer. Closes: wasmerio#4738 Signed-off-by: Daichi Fukui <daichi1.fukui@toshiba.co.jp>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'd like to resolve #4738 with the two commits involved in this PR.
I'd be happy if you could review this and merge it if the changes are satisfactory.
Thanks.