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

[Question] Is there a plan to support wasm-threads, specifically shared memory? #280

Closed
bokuweb opened this issue Nov 30, 2023 · 2 comments

Comments

@bokuweb
Copy link

bokuweb commented Nov 30, 2023

ref: bytecodealliance/wasm-tools#1306

Currently, when building with wasm32-wasi-preview1-threads using rayon, the generated wasm requires spawn_thread and shared memory. I believe shared memory is not yet considered. Are there any plans, discussions, or workarounds to address this?

@bokuweb bokuweb changed the title [Question] Is There a Plan to Support wasm-threads, Specifically Shared Memory? [Question] Is there a plan to support wasm-threads, specifically shared memory? Nov 30, 2023
@lukewagner
Copy link
Member

The current plan is to extend threading support in core wasm through the shared-everything-threads proposal. The meat of this proposal is adding shared attributes to everything (not just memory), allowing whole instances to be shared (avoiding the O(n^2) function table usage with previous approaches) as well as a new solution for thread-local storage. There's also possibly a thread.spawn instruction for actually creating a new thread, but it's contentious (since it's a lot more work for browsers) so it's possible instead that we'll need to add thread.spawn as a canonical built-in to the Component Model (which would be importable by core wasm with the shared func type added by the shared-everything-threads proposal).

@bokuweb
Copy link
Author

bokuweb commented Dec 1, 2023

@lukewagner Thanks!!!!

@bokuweb bokuweb closed this as completed Dec 1, 2023
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

2 participants