Using WebAssembly threads from C, C++ and Rust
WebAssembly threads support is one of the most important performance additions to WebAssembly. WebAssembly threads is not a separate feature, but a combination of several components that allows WebAssembly apps to use traditional multithreading paradigms on the web. WebAssembly threads use the new Worker constructor to create new underlying threads. C #. In C, particularly on Unix-like systems, the common way to use threads is via POSIX Threads provided by the pthread library. Thanks to the multithreading alone, we've seen consistent 1.5x-3x speed-ups, and were able to push those numbers even further by combining WebAssembly threads with WebAssembly SIMD! FFMPEG.WASM is a WebAssembly version of a popular FFmpeg multimedia toolchain that uses WebAssembly threads to efficiently encode videos directly in the browser. There are many more exciting examples using WebAssembly threads out there.