Skip to content
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

asynchronous IO #4

Open
Geal opened this issue Apr 19, 2018 · 1 comment
Open

asynchronous IO #4

Geal opened this issue Apr 19, 2018 · 1 comment

Comments

@Geal
Copy link
Owner

Geal commented Apr 19, 2018

currently, TCP connections are blocking (ie, they block the whole interpreter). To have a server that handles reasonable load, we might need to have blocking IO on the wasm side, that translates to async IO on the host side.
This is doable if we have a way to pause the interpreter (see wasmi-labs/wasmi#85) and start again once we get an event on the socket.

@Geal
Copy link
Owner Author

Geal commented Apr 24, 2018

with fb872b7 we have the beginning to get async IO working.
The idea would be to handle a special case in function calls:
fb872b7#diff-6819af94d9e962b4dc7ef16cb532e1f2R68

In the case of external function call (ie not the nested case), if the function is asynchronous, it would return a custom error (a "trap") from invoke_context( fb872b7#diff-6819af94d9e962b4dc7ef16cb532e1f2R66 ), and then the interpreter would keep the function stack and the function context instead of returning an error, and when we finally get the answer, we would update the context and then resume the interpreter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant