Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!lll-tis!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP Newsgroups: comp.sys.amiga Subject: Re: PIPE:... should it buffer at all? Message-ID: <611@sugar.UUCP> Date: Tue, 1-Sep-87 08:37:27 EDT Article-I.D.: sugar.611 Posted: Tue Sep 1 08:37:27 1987 Date-Received: Thu, 3-Sep-87 06:23:11 EDT References: <8708310802.AA01899@cory.Berkeley.EDU> Organization: Sugar Land UNIX - Houston, TX Lines: 20 Summary: You misunderstood. >>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. This, of course, >>would make all requests wait until the reader is ready... but Amiga PIPE:s >>don't act like UNIX pipes anyway. It would allow any buffer size to be >>transferred as an atomic operation. > > This is exactly how my PIPE:, and probably other people's PIPE's >work. Each PIPE has an associated buffer... Which means that's not how pipes work. What I suggested was not having any buffer in the pipe structure at all, but instead using the buffer provided by the writer in its message. That way if the program used an 8K buffer, it would automatically transfer 8K. If the program used 256 byte buffers, it would transfer 256 bytes. The writer would always wait for the reader to read the entire buffer, and data would be transferred straight from the writer to the reader. This would save memory and time, at the cost of making the writer wait on small writes. It's certainly worth looking into, anyway. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter -- U <--- not a copyrighted cartoon :->