4 ms·
This is a common misconception. Node (libuv) only uses the thread pool as a last resort. Many operations nowadays have a native async OS API, so they don't need
by felixfbecker 8y ago
This is a common misconception. Node (libuv) only uses the thread pool as a last resort. Many operations nowadays have a native async OS API, so they don't need to use (and therefor don't block/fill) the thread pool.
https://medium.com/the-node-js-collection/what-you-should-know-to-really-understand-the-node-js-event-loop-and-its-metrics-c4907b19da4c#07f5 https://medium.com/the-node-js-collection/what-you-should-kn...
https://stackoverflow.com/a/22644735/4208018 https://stackoverflow.com/a/22644735/4208018
- jorangreef 8y ago"Node (libuv) only uses the thread pool as a last resort." When did you last read deps/uv/src/win/fs.c or deps/uv/src/unix/fs.c? If by "last resort" you mean 99.9% of all async fs tasks, then I would agree with you.
- coder543 8y agoisn't that because OSes have broken async filesystem APIs that can't be trusted? But network requests (like dns) have well defined APIs for async, and should never be required to block a thread, and therefore do not need a threadpool.
- deleted 8y ago[deleted]