9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] getting at Windows files from VMware-hosted Plan 9
@ 2002-05-02 20:39 Scott Schwartz
  2002-05-02 21:35 ` [9fans] bidirectional pipes Mike Haertel
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Schwartz @ 2002-05-02 20:39 UTC (permalink / raw)
  To: 9fans

	<[0=1] | echo 0 > /srv/remotehost

While this is cool, I have to admit that I never really liked
bidirectional pipes, because if you want to close half of the connection,
you either need something like bsd's shutdown(), or a way to recover
your control file which hopefully will let you half-close.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] bidirectional pipes
  2002-05-02 20:39 [9fans] getting at Windows files from VMware-hosted Plan 9 Scott Schwartz
@ 2002-05-02 21:35 ` Mike Haertel
  2002-05-02 22:24   ` Scott Schwartz
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mike Haertel @ 2002-05-02 21:35 UTC (permalink / raw)
  To: 9fans

>While this is cool, I have to admit that I never really liked
>bidirectional pipes, because if you want to close half of the connection,
>you either need something like bsd's shutdown(), or a way to recover
>your control file which hopefully will let you half-close.

I'm curious?  Why does this bother you?  Just let half the connection
go unused.

My very first reaction to bidirectional pipes, when I first heard of
them in some journal article about v8 Unix many years ago, was: wow,
that is such an obvious win, why wasn't it done years ago?

The only thing I can think to explain your position is that it's a
semi-religious issue, rather like dynamically typed vs. staticly
typed languages: some people like the greater flexibility associated
with type checks only at the point you actually try to use the
value, whereas others want to get their error messages right away.
And some people like the flexibility of bidirectional pipes, whereas
others would like to get errors back from "incorrect" read and write
system calls immediately.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
  2002-05-02 21:35 ` [9fans] bidirectional pipes Mike Haertel
@ 2002-05-02 22:24   ` Scott Schwartz
  2002-05-03 10:09   ` Boyd Roberts
  2002-05-04  9:14   ` Steve Kilbane
  2 siblings, 0 replies; 8+ messages in thread
From: Scott Schwartz @ 2002-05-02 22:24 UTC (permalink / raw)
  To: 9fans

| I'm curious?  Why does this bother you?  Just let half the connection
| go unused.

I think that having two open fds is nicer than one open fd and some extra
system calls, because it's impossible to get it wrong.  Plan 9 doesn't
have a way to do half-close at all, right?  So what if your server was
"sort" instead of "ssh"?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
  2002-05-02 21:35 ` [9fans] bidirectional pipes Mike Haertel
  2002-05-02 22:24   ` Scott Schwartz
@ 2002-05-03 10:09   ` Boyd Roberts
  2002-05-04  9:14   ` Steve Kilbane
  2 siblings, 0 replies; 8+ messages in thread
From: Boyd Roberts @ 2002-05-03 10:09 UTC (permalink / raw)
  To: 9fans

Mike Haertel wrote:
> My very first reaction to bidirectional pipes, when I first heard of
> them in some journal article about v8 Unix many years ago, was: wow,
> that is such an obvious win, why wasn't it done years ago?

That fell straight out of the stream implementation of pipes;
a cross connected stream.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
  2002-05-02 21:35 ` [9fans] bidirectional pipes Mike Haertel
  2002-05-02 22:24   ` Scott Schwartz
  2002-05-03 10:09   ` Boyd Roberts
@ 2002-05-04  9:14   ` Steve Kilbane
  2 siblings, 0 replies; 8+ messages in thread
From: Steve Kilbane @ 2002-05-04  9:14 UTC (permalink / raw)
  To: 9fans; +Cc: steve

> >While this is cool, I have to admit that I never really liked
> >bidirectional pipes, because if you want to close half of the connection,
> >you either need something like bsd's shutdown(), or a way to recover
> >your control file which hopefully will let you half-close.
>
> I'm curious?  Why does this bother you?  Just let half the connection
> go unused.

Whereas my general dislike isn't so much from the bidirectional aspect
of the pipes, as from the increase in TCP complexity which, as far as I
can tell, doesn't exist for anything other than "rsh host filter". I'd
have expected the simpler protocol would be worth the effort of just
using two streams, in that particular case. I don't care whether the
streams are bi-directional, just that one can be discarded before the other.

steve




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
@ 2002-05-03  7:19 forsyth
  0 siblings, 0 replies; 8+ messages in thread
From: forsyth @ 2002-05-03  7:19 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

if it's really a pipe you can write 0 to have it read 0.
just keep that up until it goes away or you become bored.

[-- Attachment #2: Type: message/rfc822, Size: 1509 bytes --]

To: 9fans@cse.psu.edu
Subject: Re: [9fans] bidirectional pipes
Date: Thu, 2 May 2002 14:55:04 -0700
Message-ID: <20020502215511.64BD919A5F@mail.cse.psu.edu>

A reason to close one direction of a pipe is if the program
at the other end of the pipe is a filter (think "ssh system command")
and you need it to see EOF before you can be sure of getting
all its output back in the other direction.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
@ 2002-05-02 22:30 Russ Cox
  0 siblings, 0 replies; 8+ messages in thread
From: Russ Cox @ 2002-05-02 22:30 UTC (permalink / raw)
  To: 9fans

> | I'm curious?  Why does this bother you?  Just let half the connection
> | go unused.
>
> I think that having two open fds is nicer than one open fd and some extra
> system calls, because it's impossible to get it wrong.  Plan 9 doesn't
> have a way to do half-close at all, right?  So what if your server was
> "sort" instead of "ssh"?

Then you can set it up with a different pipe for
input and for output, and then close the input pipe.
Problem solved.  This is what rc does by default.
The <[0=1] explicitly worked around this.

If you'd rather have one fd and don't need the half-open
nonsense, you can use the same pipe for both.

The only real difference is that if you try to write to
a pipe that it only makes sense to read from, you won't
notice when the pipe is bidirectional.

Russ


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bidirectional pipes
@ 2002-05-02 21:55 Geoff Collyer
  0 siblings, 0 replies; 8+ messages in thread
From: Geoff Collyer @ 2002-05-02 21:55 UTC (permalink / raw)
  To: 9fans

A reason to close one direction of a pipe is if the program
at the other end of the pipe is a filter (think "ssh system command")
and you need it to see EOF before you can be sure of getting
all its output back in the other direction.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-05-04  9:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-02 20:39 [9fans] getting at Windows files from VMware-hosted Plan 9 Scott Schwartz
2002-05-02 21:35 ` [9fans] bidirectional pipes Mike Haertel
2002-05-02 22:24   ` Scott Schwartz
2002-05-03 10:09   ` Boyd Roberts
2002-05-04  9:14   ` Steve Kilbane
2002-05-02 21:55 Geoff Collyer
2002-05-02 22:30 Russ Cox
2002-05-03  7:19 forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).