Posted May 28, 2009 8:11 UTC (Thu) by elanthis (guest, #6227)
Parent article: Quotes of the week
The POSIX I/O isn't really meant to be a general user-friendly API. That's what the C stdio facilities are for. POSIX I/O is intentionally a low-level affair used to implement higher-level facilities, and exists largely because sometimes you need very explicit control.
If write() were to always block instead of doing partial writes, for example, then multiplexed applications would become very unstable. A single bad connection or bad drive could cause the whole thing to lock when it otherwise could continue running just fine.
A great deal of coders seem to think that the answer there is to use threads or asynchronous I/O to work around blocking I/O. Those coders are, if I may say so, dumb. Single-threaded multiplexed I/O is relatively easy and painless thanks to very behavior of write() that Andi is upset with, and more general purpose blocking I/O is relatively easy thanks to the C stdio facilities and other toolkits.