On Mon Jul 20 22:05:50 EDT 2009, r...@swtch.com wrote: > The programs that know about the signal are > not the programs that need to be worried about. > I'm much more worried about making sure that > commands like > > grep pattern /n/dump/slow/slow/sys/log/mail | sed 5q > > stop as early as possible. The note is nice > precisely because it doesn't involve editing the > source for every command.
if the grep has very few matches, it could process for quite a long time before needing to write at all. is this really effective in saving cpu? also, the only case that is a problem is when the return status of writes is not checked. (or am i missing something?) and the problem will resurface on a pipe accessed through the mount driver. - erik