News for hackers. Stuff that matters.
Re:JavaScript in Parallel: Web Workers and SharedArrayBuffer by ic4l on Saturday March 04, 2017 @02:45AM (#13789857)
Well for one workers do not share scope, and at the moment sharing memory between the two is quite difficult. Second is race conditions like @btilly explained.

Right now workers are mainly used for extreme situations and eventually make it into libraries that others use.

I have created a library called Task.js that surfaces this idea into a promise compatible interface where you can just convert a pure function into a worker function. The end result is a promise supported function thats sends the function to a worker with your provided args and resolves when its done (also supports multiple workers and automatic queuing).

https://github.com/icodeforlove/task.js

There are no comments on this comment yet.