← Back to release summary

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

Ecosystem

Explainers: https://github.com/WebAssembly/shared-everything-threads/blob/main/proposals/shared-everything-threads/Overview.md

View on chromestatus.com