-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add canonical thread.*
builtins
#291
Conversation
This change adds the `thread.spawn` and `thread.hw_concurrency` builtins in line with what was proposed in the shared-everything threads [proposal]. [proposal]: https://github.com/WebAssembly/shared-everything-threads/blob/main/proposals/shared-everything-threads/Overview.md#thread-management-builtins
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 generally good so far; nice work! Is the only other thing left to add before this PR is complete the binary encoding of thread.spawn
and thread.hw_concurrency
in Binary.md?
Co-authored-by: Luke Wagner <[email protected]>
Co-authored-by: Luke Wagner <[email protected]>
Co-authored-by: Luke Wagner <[email protected]>
I assume that any parallelism introduced by these built-ins are contained to the component instance that spawned them, and that cross-component communication (including client<->host) is still required to be fully sequential in order to comply with the component invariants. It might be worthwhile to throw in a quick clarification of this under the new Threads section in the explainer. |
@badeend That's correct yes. A future (more extensive) extension to the C-M would be to add |
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.
Ah nice, that closes out a lot of questions; thanks! LGTM w/ these nits fixed. I'll wait another week or so for any other feedback before merging.
Co-authored-by: Luke Wagner <[email protected]>
Co-authored-by: Luke Wagner <[email protected]>
I think all the actionable feedback has been addressed, so I'll plan to merge at the end of the week unless anything new comes up. |
This change adds the
thread.spawn
andthread.hw_concurrency
builtins in line with what was proposed in the shared-everything threads proposal.