Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!decwrl!shelby!agate!violet.berkeley.edu!pete From: pete@violet.berkeley.edu (Pete Goodeve) Newsgroups: comp.sys.amiga.tech Subject: Re: PIPEs Summary: "Fan-out" pipes Message-ID: <1990Nov10.082242.22949@agate.berkeley.edu> Date: 10 Nov 90 08:22:42 GMT References: <2641@mtecv2.mty.itesm.mx> <7005@sugar.hackercorp.com> <1990Nov8.101107.5884@zorch.SF-Bay.ORG> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: University of California, Berkeley Lines: 65 In <1990Nov8.101107.5884@zorch.SF-Bay.ORG>, Kent Paul Dolan (xanthian@zorch.SF-Bay.ORG) writes: > > I like the "+" convention, but I'd rather use "-<" and ">-" with it, so > that I could say: > > cmda args -<{1,2} + > cmdb args -<{1,2,3} + | >-1 cmdc args -<2 + | >-2 cmdd args -<4 + | >-3 cmde args -<1 + | >-4 cmdf args > result > > and have cheap to type, multiple input, multiple output "named" pipes, > [....] > > This would be a nice syntax for Pete Goodeve's pipe mechanism (which > does its interleave synchronization at the message-full level) when he > gets the fan-out side working to go along with the fan-in side. > Hmmm. What an interesting idea... In fact it gets more intriguing as I think on it. "Fan out pipes" are something that even unix can't do, as far as I can see. (You can 'tee' to a pipe and a file, but not to two parallel pipes, can you?) And a convenient way of "broadcasting" data to a number of processes is something that I've had on my mind for a long, long time. Kent's scheme might need a fair amount of "thinking" on the part of the shell -- or 'pipe' program if that was the way it was done (in fact, with the '+' termiator, it could easily be a separate program) -- because several fan-out processes might have to be started. Could be done, though. My immediate intentions ["immediate" - hah! I've just been sitting on it for about three months...] were to make a simple 'ITEE' program, that would take one input (ppipc) stream, and distribute copies of this to as many outputs as you had specified in the command line. I guess you could have the 'pipe' command start copies of this -- or some variant -- as necessary. I've been thinking about the convention that Kent suggests, though, and I wonder if it wouldn't be better to reverse it: PIPE cmda args >-{1,2} + cmdb args >-{1,2,3} + -<1 cmdc args >-2 + -<2 cmdd args >-4 + -<3 cmde args >-1 + -<4 cmdf args > result This isn't much worse (to my eye!) in appearance that the other, but a) it does not conflict with standard redirection direction (:-)), and b) it makes command line parsing MUCH easier, because you're already looking for the '>' redirection character. Special sequences at the BEGINNING of a line are always easy to find. Of course you'd have to avoid file names beginning with '-'... In fact there are LOTS of variants one could consider. I suppose once could make the convention EXACTLY equivalent to the current one, with redirection in the standard AmigaDOS place after the command. Or you might use the pairs '|<' and '>|'. Whatever, it's worth thinking on. -- Pete --