News for hackers. Stuff that matters.
Re:Why am I excited about WebAssembly? by Animats on Sunday July 17, 2022 @03:43PM (#32130461)
What do you do about WebAssembly's lack of real threads?
Re:Why am I excited about WebAssembly? by cylon13 on Sunday July 17, 2022 @04:36PM (#32130968)
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.
Re:Why am I excited about WebAssembly? by Animats on Sunday July 17, 2022 @04:47PM (#32131068)
That's very helpful. Thanks.
Re:Why am I excited about WebAssembly? by modeless on Sunday July 17, 2022 @04:43PM (#32131034)
It has real threads now, doesn't it? SharedArrayBuffer was reenabled in all browsers.
Re:Why am I excited about WebAssembly? by Animats on Monday July 18, 2022 @06:10PM (#32144657)
Sort of. It's more like processes with shared memory.
Re:Why am I excited about WebAssembly? by modeless on Tuesday July 19, 2022 @01:43AM (#32147952)
Emscripten has pthreads support. Maybe it's not perfect but it seems like a lot more than processes with shared memory to me.