Re:Why not C++?
by stefs on Saturday March 05, 2016 @02:54PM
(#11230752)
i think this is strange. i'm not a c++ programmer, but the evented frameworks (node.js or vert.x) are doing it the other way round: use threads only for IO (or computation so heavy it's practically blocking). the complete opposite.
[ Parent
| on HN ]
libuv (used by Node.js) uses epoll, kqueue, etc. for network I/O. It uses a thread pool for all file operations.
ah, well - when reading "blocking io" i first thought about the file system. so does my point still stand? using a threadpool for disk IO does go against "threads should only be used to exercise multiple CPU cores and never as a way to work around blocking IO."
or am i still not getting this?
Actually node.js does it the same way. Under the covers node.js handles IO with libev which is an event library.