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
lukewagner
left a comment
There was a problem hiding this comment.
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 <mail@lukewagner.name>
Co-authored-by: Luke Wagner <mail@lukewagner.name>
Co-authored-by: Luke Wagner <mail@lukewagner.name>
|
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 |
lukewagner
left a comment
There was a problem hiding this comment.
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 <mail@lukewagner.name>
Co-authored-by: Luke Wagner <mail@lukewagner.name>
|
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.spawnandthread.hw_concurrencybuiltins in line with what was proposed in the shared-everything threads proposal.