Using thread pool in WebAssembly

Emscripten has support for pthreads (it implements it using shared memory and webworkers)

@permutationlock’s example shows how to use emscripten with threads:

This is based on @permutationlock’s usage of emscripten and a few other things, however I currently don’t have the pthread flags to emscripten activated in that project at the moment (because the game doesn’t really need it right now (it is commented out)).

I am also planning to update my zigraylib project to use the emscripten dependency of the raylib project, so that you don’t have to manually install emscripten (but got side tracked by another project).

3 Likes