News for hackers. Stuff that matters.
Re:Piscina – The Node.js Worker Pool by barefeg on Tuesday March 23, 2021 @03:37PM (#26559388)
I’m guessing the fact that node is single threaded
Re:Piscina – The Node.js Worker Pool by nobleach on Tuesday March 23, 2021 @04:28PM (#26559994)
JavaScript is single threaded, Node is most certainly not.
Re:Piscina – The Node.js Worker Pool by gbrits on Tuesday March 23, 2021 @06:20PM (#26561073)
Yes it surely is
Re:Piscina – The Node.js Worker Pool by zbentley on Tuesday March 23, 2021 @06:50PM (#26561349)
My "htop" display surely disagrees. So do my node programs that lag out waiting for disk IO thread pool slots. Sounds does node's documentation: https://nodejs.org/api/worker_threads.html
Re:Piscina – The Node.js Worker Pool by hmcdona1 on Tuesday March 23, 2021 @06:50PM (#26561352)
It's not exactly. Certain operations like I/O are threaded in Node. libuv has it's own threadpool that it uses for a lot of these types of tasks.
Re:Piscina – The Node.js Worker Pool by jayflux on Wednesday March 24, 2021 @04:52AM (#26564903)
Node uses a thread pool for tasks like reading files async and crypto operations etc, you can read about it here https://nodejs.org/en/docs/guides/dont-block-the-event-loop/