From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Mon, 20 Jul 2009 22:15:58 -0400 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] i/o on a hangup channel asymmetry Topicbox-Message-UUID: 296a97ce-ead5-11e9-9d60-3106f5b1d025 On Mon Jul 20 22:05:50 EDT 2009, rsc@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