Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!ptsfa!hoptoad!academ!uhnix1!nuchat!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga Subject: Re: PIPE:... should it buffer at all? Message-ID: <628@sugar.UUCP> Date: Thu, 3-Sep-87 06:28:32 EDT Article-I.D.: sugar.628 Posted: Thu Sep 3 06:28:32 1987 Date-Received: Sat, 5-Sep-87 17:38:36 EDT References: <571@sugar.UUCP> <92@stb.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 49 Keywords: PIPE: buffer UNIX pipes Summary: I wasn't aware "PIPE:" allowed multiple writers. In article <92@stb.UUCP>, michael@stb.UUCP (Michael) writes: > In article <571@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: > >It occurred to me that the most efficient way to handle PIPE: is to use the > >writer's buffer to hold the data while waiting for the reader. > > Please, no. We already have any size atomic operations--the order of the > operations are specified by the order that the messages come in. Really? That seems to imply a certain lack of parallelism. I guess it's OK. But that doesn't address the efficiency question. If you're writing an 8K buffer into a 2K PIPE:, it takes 4 transfers, with 4 sets of: Copy 2K to pipe.... Copy 2K to reader.... Note that the following is not related to the previous suggestion. > >Alternatively, how about making PIPE: act like the UNIX pipe? That is, you > >can open it and write as much as you please without waiting until you fill ^^^^^^^^^^^ > >it up. You can have multiple writers but only one reader. The pipe hangs ^^^^^^^^^^^^^^^^ > >around as long as a single writer *or* reader wants it. And finally you can > >reopen it without losing data. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Gee, thats how I thought PIPE: worked. Nope. If you open it, you currently wait for the reader to open it too. You can also only have one writer. And if the writer closes it and the reader closes it it goes away even if there's still data in it. This makes it useless as a printer buffer (the obvious application for it: you open PIPE:spool and write your data. Have a program read from PIPE:spool and write to PRT:. Make PIPE:spool 16K long. Instant buffer.) > Besides, I like P:, which can have multiple readers. I find it hard to fathom the use of multiple readers to a single pipe. Perhaps you can describe an application you've used this feature for. > : Copy protection? Just say Pirate! (if its worth pirating) How are people supposed to take you seriously if you say things like this? -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter -- U <--- not a copyrighted cartoon :->