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

Add thread.spawn_indirect #447

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

abrown
Copy link
Contributor

@abrown abrown commented Feb 7, 2025

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 rename thread.spawn to thread.spawn_ref.

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
Comment on lines +3818 to +3820
* `$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)
Copy link
Contributor Author

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.

Copy link
Contributor Author

@abrown abrown Feb 7, 2025

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] -> [].

abrown added a commit to abrown/wasm-tools that referenced this pull request Feb 7, 2025
This encoding change is necessary due to recent additions to the
component model; see [bytecodealliance#447].

[bytecodealliance#447]: WebAssembly/component-model#447
abrown added a commit to abrown/wasm-tools that referenced this pull request Feb 7, 2025
[bytecodealliance#447] tries to make the built-in naming a bit more consistent; this
change propagates that here.

[bytecodealliance#447]: WebAssembly/component-model#447
abrown added a commit to abrown/wasm-tools that referenced this pull request Feb 7, 2025
This encoding change is necessary due to recent additions to the
component model; see [bytecodealliance#447].

[bytecodealliance#447]: WebAssembly/component-model#447
abrown added a commit to abrown/wasm-tools that referenced this pull request Feb 7, 2025
[bytecodealliance#447] tries to make the built-in naming a bit more consistent; this
change propagates that here.

[bytecodealliance#447]: WebAssembly/component-model#447
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

Successfully merging this pull request may close these issues.

1 participant