I am learning Node.js
I have found this note on libuv official documentation-
“ libuv
uses a thread pool
to make asynchronous file I/O
operations possible, but network I/O
is always performed in a single thread, each loop’s thread.”
My question is for below statement(from an unofficial resource) -
"Today’s operating systems already provide asynchronous interfaces for many I/O tasks (e.g. AIO on Linux). Whenever possible, libuv will use those asynchronous interfaces, avoiding usage of the thread pool."
-- is this Statement true for asynchronous file I/O operations
or only applicable for Network I/O
?
- Means if there is File I/O operation then in this case thread pool will be used compulsory or libuv will use those asynchronous interfaces, avoiding usage of the thread pool?
- Does Libuv use thread pool for Network I/O ?
dns.lookup
andgetaddrinfo
is handled by the thread pool. also crypto and http get post if hostname is provided. refer: youtu.be/P9csgxBgaZ8?t=16m51s – Jacklin