-
Notifications
You must be signed in to change notification settings - Fork 63
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
std::thread
support
#247
Comments
Hi there, thanks for asking! The current work on thread support for WASI Preview 2 is tracked in the wasi-threads repo. This builds on the Wasm Core Threads proposal. Right now it's still too early to try and implement So unfortunately right now there's nothing we can do here. But my hope is that after the Preview 2 release threads become a priority, and we'll be able to add experimental support for it as soon as the spec authors believe we should. |
It's a sad thing that the |
See WebAssembly/wasi-threads#48 (comment) for more context |
Please excuse me for continuing the discussion. Reading the link above, it's now clear that
If |
Part of the acceptance criteria for any WASI proposal is that it has multiple implementations. I don't expect us to want to wait for the proposal to reach phase 4 before implementing, but instead implement it sooner in order to help the proposal progress through the stages. I haven't been in the room for the WASI Threads presentations and discussion, but my understanding is that the current plan is what I shared earlier: support for threads needs to land in Wasm Core first. And then thread spawning support for WASI and Wasm Components can be implemented in terms of that. I wouldn't worry too much about specific stages and timelines; for several members of the ByteCode Alliance this is one of the highest priority items after the Preview 2 release. That means work on it is likely going to be funded, and we might see it progress relatively fast. |
The importance of thread spawning to our users is very well understood, and it is being prioritized above many other worthy tasks right now.
We expect that anything that happens with WebAssembly specification can be a slow process because it takes a lot of work and coordination across many different companies. In particular, Web engines are very conservative in what they ship because once they ship a feature they can never undo it or break it without breaking the Web itself, something they work very hard to never do. But as Yosh says, many of the companies involved have made thread spawning a business priority and are funding experts to work on it, and the Bytecode Alliance is exploring ways to ship thread spawn before Web engines do. One thing we do need to do better is communicate to the current and potential users of |
Right now, using
std::thread::spawn
leads to panic. I'm aware thatwasm32-wasi
doesn't have thread support, butwasm32-wasi-preview1-threads
does. Is there any way to use threads on the browser?WebAssembly.memory
and web workers allow parallelization on the web. Doesjco
make the use out of them right now? If not, where should I start to contribute?The text was updated successfully, but these errors were encountered: