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

Tasking #3

Closed
Keno opened this issue Jan 4, 2019 · 2 comments
Closed

Tasking #3

Keno opened this issue Jan 4, 2019 · 2 comments

Comments

@Keno
Copy link
Owner

Keno commented Jan 4, 2019

I've been thinking about how to implement tasking on top of wasm. Wasm coroutines are a planned feature (https://github.com/WebAssembly/design/blob/master/FutureFeatures.md#coroutines), but no work has been done toward it, as far as I can tell. I've looked at how go implements goroutines and it looks like they're just using explicitly managed stacks in linear memory (but I'll need to look into this further). That's a bit tricky, because you you can't just push a return address onto the linear stack and jump to it. Tail calls (https://github.com/WebAssembly/tail-call/blob/master/proposals/tail-call/Overview.md) may help there, but I'm not sure they're implemented yet. We'd also need an LLVM pass that splits any function at a call boundary and turns it into push return/tail call.

@Keno
Copy link
Owner Author

Keno commented Jan 4, 2019

Some more info about how go works:
The have a global PC_F that indicates the next function to call and a loop and call_indirect's in a loop (https://github.com/golang/go/blob/master/src/runtime/rt0_js_wasm.s#L61).

@Keno
Copy link
Owner Author

Keno commented Jul 30, 2019

This is solved by JuliaLang/julia#32532.

@Keno Keno closed this as completed Jul 30, 2019
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