wasmerio / wasmer-js

Monorepo for Javascript WebAssembly packages by Wasmer

Home Page:https://wasmerio.github.io/wasmer-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does wasmer.js have polyfill for threads?

temeddix opened this issue · comments

As the title says, does wasmer.js provide polyfill for threads, like std::thread in Rust?

Hey @temeddix , we are very close to release a new version of wasmer-js with support for threads and many more things already supported by WASIX. Stay tuned!

Thanks for the quick reply :) does that mean we can use WASI threads on web browsers?

Indeed, very soon!

Can't wait!

We just released @wasmer/sdk which fully supports WASIX. The API is a bit still in flux, but you can check some samples of how to use it here: https://github.com/wasmerio/wasmer-js/blob/main/examples/wasmer.sh/index.ts

The @wasmer/sdk package supports multi-threading and multi-processing, so I think it's okay to close this ticket.

One thing to keep in mind is that you need to compile to WASIX to use these APIs. WASI preview 1 doesn't include syscalls for threads or processes.