2 ms·
If you rely on blocking I/O, you've got to deal with blocked processes as i/o isn't instant. You can deal with that by having lots of threads or processes doin
by toast0 4y ago
If you rely on blocking I/O, you've got to deal with blocked processes as i/o isn't instant.
You can deal with that by having lots of threads or processes doing the work, but coordinating many threads can be difficult. With async sendfile, you let the kernel manage all of this without needing userspace to do anything, and the kernel is well organized to manage pushing data to the right place when disk i/o completes.
If you just want to write code in blocking style, check out Erlang, but know that under the hood it massages most of the blocking into aggregated select/kqueue/epoll/etc calls.