Patching WebAssembly thread implementation - chung-leong/zigar GitHub Wiki

JavaScript | PHP


As of Zig 0.16.0, thread support for WebAssembly is still a work in progress. When multithreaded is set to true, the Zig compiler will fail with a message informing you that multithread support for WasmAllocator is still a TODO item.

In order to use multithreading in your app, you will have to hot-patch the Zig standard library.

Zigar provides a mean to apply the patch with a single command:

npx zigar patch

The patch file is question is here.

On Windows, you should run the command inside Git Bash (which has the patch program).