-
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 thread.spawn_indirect
#447
base: main
Are you sure you want to change the base?
Conversation
This change codifies the conclusions we arrived to in [WebAssembly#89]. It adds a new way to spawn threads, `thread.spawn_indirect`, which retrieves the thread start function from a table. This prompted me to rename `thread.spawn` to `thread.spawn_ref`. [WebAssembly#89]: WebAssembly/shared-everything-threads#89
* `$ft` must refer to a `shared` function type; initially, only the type `(func | ||
shared (param $c i32))` is allowed (see explanation in `thread.spawn_ref` | ||
above) |
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.
What I can't remember well is whether we truly need $ft
in the definition. I left it in for now, but it would seem that without it we can still statically verify from the type of $t
that the table elements are in fact shared function references.
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.
Implementation-wise it is $ft
that is problematic currently, so at least temporarily it isn't too useful anyways seeing as we must fix the start function to only [i32] -> []
.
This encoding change is necessary due to recent additions to the component model; see [bytecodealliance#447]. [bytecodealliance#447]: WebAssembly/component-model#447
[bytecodealliance#447] tries to make the built-in naming a bit more consistent; this change propagates that here. [bytecodealliance#447]: WebAssembly/component-model#447
This encoding change is necessary due to recent additions to the component model; see [bytecodealliance#447]. [bytecodealliance#447]: WebAssembly/component-model#447
[bytecodealliance#447] tries to make the built-in naming a bit more consistent; this change propagates that here. [bytecodealliance#447]: WebAssembly/component-model#447
This change codifies the conclusions we arrived to in #89. It adds a new way to spawn threads,
thread.spawn_indirect
, which retrieves the thread start function from a table. This prompted me to renamethread.spawn
tothread.spawn_ref
.