|
|
|
|
|
by apatheticonion
280 days ago
|
|
That still requires a bunch of glue code right? Like, I can't simply compile my application to a wasm target and threads just work cargo build --release --target wasm64
I think wasi has access to threading, but I don't think browsers support wasi? |
|
It’s not WASI that gives you access to threading. Multi threading is a WebAssembly spec feature. Each thread is a separate web assembly module, they can share memory/code using SharedArrayBuffer if needed or WebAssembly tables for code. The host runtime for WASM whether it’s the web or something like wasmtime is responsible for instantiating those module in Web workers on the Web (or node…) or in new OS threads for wasmtime. I guess this is the thick amount of glue needed