WebAssembly shared-everything threads
- Category
- WebAssembly
- Type
- New or changed feature
- Status
- No active development (Chrome No active development)
- Intent stage
- None
Summary
Allow all kinds of WebAssembly objects, not just memories, to be shared between threads, enabling WasmGC programs to use shared-memory multithreading and avoiding the need for threads to have separate WebAssembly instances. This feature also improves the performance of multithreaded WebAssembly programs via new release-acquire atomic accesses, managed waiter queues, and an instruction for improving the efficiency of spin locks.
Motivation
Programs must be multithreaded to take full advantage of modern hardware, but WebAssembly currently has a number of restrictions that prevent it from taking full advantage of multithreading. Only WebAssembly memories can currently be shared between threads, so languages that compile to WasmGC cannot use threads at all. WebAssembly also only supports sequentially-consistent atomic accesses, which are much stricter and slower than necessary to support common languages. This feature removes those restrictions, improving performance for compute-heavy applications in a wider variety of languages.
Standards & signals
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=webassembly-shared-everything-threads
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+WebAssembly%20shared-everything%20threads
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=WebAssembly%20shared-everything%20threads
- Baseline status: https://webstatus.dev/?q=WebAssembly%20shared-everything%20threads