Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What do you do about WebAssembly's lack of real threads?


With shared array buffers it’s not actually a big problem. We’re building a multithreaded game that targets wasm and we just spin up workers up front which all use the same shared memory, and then just use standard concurrency primitives to schedule work on them. Just have to be careful not to block on the main thread, and you have to serve all your assets from the same domain for browsers to allow you to make shared array buffers.


That's very helpful. Thanks.


It has real threads now, doesn't it? SharedArrayBuffer was reenabled in all browsers.


Sort of. It's more like processes with shared memory.


Emscripten has pthreads support. Maybe it's not perfect but it seems like a lot more than processes with shared memory to me.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: