In Emscripten that uses a pthread implementation layer built on top of Web Workers + a shared wasm Memory. Basically memory is shared, and you have atomic instructions, and each thread of execution gets its own Web Worker.
That has some limitations, but for the most part it works just like you would expect pthreads to.
The main thread is a little special on the Web since it can't block, which can cause issues (like pthread_create doesn't immediately create an available pthread). There are workarounds for most of those issues (like pre-allocating a threadpool), and many applications work well, but sometimes not out of the box. See
That has some limitations, but for the most part it works just like you would expect pthreads to.