3 ms·
Node.js uses libuv for async file operations -- And libuv has its own internal thread pool to make file ops appear fully async to a node program. From the libu
by satori99 6y ago
Node.js uses libuv for async file operations -- And libuv has its own internal thread pool to make file ops appear fully async to a node program.
From the libuv docs [0]:
Unlike network I/O, there are no platform-specific file I/O primitives libuv could rely on,
so the current approach is to run blocking file I/O operations in a thread pool.
For a thorough explanation of the cross-platform file I/O landscape, checkout this post [1].
[0] http://docs.libuv.org/en/v1.x/design.html#file-i-o http://docs.libuv.org/en/v1.x/design.html#file-i-o
[1] https://blog.libtorrent.org/2012/10/asynchronous-disk-io/ https://blog.libtorrent.org/2012/10/asynchronous-disk-io/