JavaScript Web Workers
The cluster discusses Web Workers as a means to achieve multi-threading in JavaScript, highlighting their limitations like message passing instead of shared memory, comparisons to processes, and mentions of SharedArrayBuffer and WebAssembly threads.
Activity Over Time
Top Contributors
Keywords
Sample Comments
In case people aren't aware there is webworker-threads although this doesn't really solve the same problem.
WebWorkers only support message passing, it's more like processes than threads. There's no concept of shared memory.
What about web workers, service workers, web assembly threads..?
JS has web workers, not shared memory between threads.
You mean like with web workers or something?
Call me when JavaScript supports threads and not just web workers :(
Web workers are more like multiple processes than multiple threads, but yes, there are ways to use more than one CPU core in JS too.
Too bad JS is single threaded. And the overhead of WebWorkers (multi process) makes it too expensive for all but some niche workloads.
SharedArrayBuffer is only available in chrome and FF and they disable it by default so no way to do standard multithreading via webworkers.
WebWorkers don't really add a lot of complexity to something like this.