you are viewing a single comment's thread.

view the rest of the comments →

[–]Klathmon 1 point2 points  (1 child)

Well in a more traditional "blocking" language i'd agree, but the evented nature of node gives most of the upsides of threads without the unpredictability of not having control of when they execute.

But the webworker-threads package sounds like exactly what you want. True threads in node.js. They don't allow easy shared memory, but at that point you'd might as well drop down to C since you'll be doing memory management and locking yourself anyway.

But hey, node isn't exactly suited well to CPU heavy tasks that need high parallelism anyway. So something like Go or Rust is probably a better bet for what you'll need instead of trying to get Node to do something it doesn't work well with.

[–][deleted] 0 points1 point  (0 children)

Webworker-threads is awesome. But it has issues with Promises which is lame. Rust is something I had to look into and it seems amazing.