[TUHS] the sin of buffering [offshoot of excise process from a pipeline]

Doug McIlroy doug at cs.dartmouth.edu
Wed Jul 16 09:43:49 AEST 2014


Yes, an evil necessary to get things going. 
The very definition of original sin.

Doug

Larry McVoy wrote:

>>>> For stdio, of course, one would need fsplice(3), which must flush the
>>>> in-process buffers--penance for stdio's original sin of said buffering.

>>> Err, why is buffering data in the process a sin? (Or was this just a
>>> humourous aside?)
 
>> Process A spawns process B, which reads stdin with buffering. B gets
>> all it deserves from stdin and exits. What's left in the buffer,
>> intehded for A, is lost. Sinful.
 
> It really depends on what you want.  That buffering is a big win for
> some use cases.  Even on today's processors reading a byte at a time via
> read(2) is costly.  Like 5000x more costly on the laptop I'm typing on:



More information about the TUHS mailing list