Depends on the operating system. This is one reason why it is folly to try to abstract away the differences between operating systems.
Ordinary Linux file i/o for example cannot be made non-blocking and ignores O_NONBLOCK flag. See open(2).
Ordinary Linux file i/o for example cannot be made non-blocking and ignores O_NONBLOCK flag. See open(2).
well reading and writing can, opening can't. there was also a good conversation about that on HN: https://news.ycombinator.com/item?id=17654550
https://lwn.net/Articles/810414/
For cases like that discussion about opening lots of files over NFS this should allow it to be done completely async. The actual time to do it won't be better on a per file basis but you'd be able to parallelize them and do other work while waiting on the opens to complete.
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[1] https://blog.libtorrent.org/2012/10/asynchronous-disk-io/
Lookup the libuv threadpool for more details.