From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; delsp=yes; format=flowed Date: Sun, 19 Jul 2009 13:32:14 -0700 From: Roman Shaposhnik In-reply-to: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-id: References: Subject: Re: [9fans] i/o on a hangup channel asymmetry Topicbox-Message-UUID: 27867edc-ead5-11e9-9d60-3106f5b1d025 On Jul 19, 2009, at 2:30 AM, Charles Forsyth wrote: >> perhaps i've been asleep at the swtch, but i don't recall seing >> writes >> on closed channels terminate programs with a note. > > sys: write on closed pipe > > mainly to kill off a pipeline when the thing at the end has finished. > i think that might be the only instance where a note is used. I had considered this theory. And it definitely explains why such a behavior would be beneficial for the pipelined jobs. What makes me unhappy, though, is that for things that are *not* connected to the pipe, but rather to a different kind of channel, it makes things more difficult without any clear benefit. Even for the pipelined case -- consider what happens when the thing at the beginning exits: the next consumer has to be aware of EOF condition first (and if it skips over EOF of the read returning -1). The consumers are offered a chance to shutting down gracefully, where the producers are not. Why inequality? Thanks, Roman.