Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!sdcsvax!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU.UUCP Newsgroups: comp.sys.amiga Subject: Re: PIPE:... should it buffer at all? Message-ID: <8708310802.AA01899@cory.Berkeley.EDU> Date: Mon, 31-Aug-87 04:02:05 EDT Article-I.D.: cory.8708310802.AA01899 Posted: Mon Aug 31 04:02:05 1987 Date-Received: Tue, 1-Sep-87 01:16:51 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 18 >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. When there is enough free space in the buffer, write requests are copied and returned immediately. If there is not enough free space, write requests are queued until (A) enough free space accumulates in the buffer or (B) a read request is big enough not only to drain the buffer, but to eat at parts of pending write requests as well. The major problem all of us 'PIPE writers have been experiencing is attempting to handle programs which open the same file (pipe) several times to handle C open modes before finally settling down on one file handle. -Matt