-
Notifications
You must be signed in to change notification settings - Fork 824
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
Implemented an asyncify based implementation of asynchronous threading #3710
Conversation
….a. asynchronous threading
… thinks the wake has failed when it has actually succeeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good from me for the API side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so happy about putting more logic into the logic in binfactory/exec.rs
, I really wanted to move away from that to make the logic less dependent on it.
Calls like WasiEnvBuilder::run()
do not go through that flow.
We should but this into some reusable function , that preferably also does not require spawning threads.
Only did a supferficial review, more in-depth after we discuss it. Also:
|
the snapshot tests already extensively test this (forking, http web server, etc...) - what we lack are tests in the JS area but that is not for this pull request |
Quite some refactoring to get the snapshot tests working - there were a number of edge cases that were failing |
…reads and explciti tests with async threads
Tests have been added in snapshots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me from the API side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only partial, final review to come.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on the API side
This pull request implements
asynchronous threading
In essence what this does is allow the runtime to exit a WASM thread and resume it where it left off after an
async
condition passes - when coupled with the WASIX syscalls this allows for all waits and IO operations to unload their WASM threads when going idle.In future this will allow a designer to
move
threads from one machine to anotherPerformed some benchmarks and asynchronous threading gives approximately a 6% increase in performance thus the benefits of parking idle threads appears to out way the overhead of managing them (tested with multiple runs).
before:
after: