[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The primitiveness of pipe



> Can't you make a two processes intercommunicate merely by doing
> 	foo |[0=1] bar
> ?  Seems like the real concern in any event is deadlock.

nope.  only one (unidirectional) pipe is created.  |[n=m] just
changed the file descriptors assigned to the pipe in the left
and right-hand processes.  one could kludge up some notation like

	foo |[0,1=0,1] bar

but i don't like it, and don't want to count on the underlying
system providing bidirectional pipes.

on the other hand, i you do know you have bidirectional pipes,
you can do

	foo <[0=1] | bar >[1=0]

to create a circular pipe, so now is when you have to start
worrying about deadlock, etc.

does anyone really want circular pipes?  Mark Rochkind wrote
a shell ages ago which let you create them, but there didn't
seem to be a real win.

<{} and >{} let you create arbitrary acyclic pipelines.
cyclic pipelines seem problematic in the presence of
buffering on pipes.  certainly most unix tools would not
behave properly in circular pipelines.

paul