From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 6 Sep 2007 16:04:15 +0200 From: Enrico Weigelt To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Pipes on UNIX Message-ID: <20070906140414.GA26188@nibiru.local> References: <45219fb00709060604s2d6fc50ex270cfcf30c36067a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <45219fb00709060604s2d6fc50ex270cfcf30c36067a@mail.gmail.com> User-Agent: Mutt/1.4.1i Topicbox-Message-UUID: b91c2d18-ead2-11e9-9d60-3106f5b1d025 * Llu=EDs Batlle wrote: Hi, although, it's quite OT ... > I understand from [1] that named pipes are suposed to use the > filesystem as an "unlimited" buffer for the pipe.=20 Actually, not. (at least on Unix) Pipes are FIFOs with an limited buffer size (ie on linux-2.4 of one=20 page=3D4k, on linux-2.6 IMHO 64k). And pipes are always meant for an=20 sequential and continous data flow between reader and writer. Yes,=20 there are some deadlock flaws (experienced them by myself ie. w/=20 sun-jdk), but they don't come from a limited buffer, but unclean=20 handling of tricky situations (ie too large or asymetric chunks on=20 reader vs. writer). You probably can work around them by reading byte per byte (ugly!). Maybe you would like to have a look at Unix Domain Sockets. They support bi-directional transfers, fd passing (at least @ Linux) and packet transfer. You can control many things using setsockopt(1). > Or maybe the named pipes were never supposed to use the disk as > the pipe buffer? Exactly. For those things you could simply write an little 9p server ;-) =20 cu --=20 --------------------------------------------------------------------- Enrico Weigelt =3D=3D metux IT service - http://www.metux.de/ --------------------------------------------------------------------- Please visit the OpenSource QM Taskforce: http://wiki.metux.de/public/OpenSource_QM_Taskforce Patches / Fixes for a lot dozens of packages in dozens of versions: http://patches.metux.de/ ---------------------------------------------------------------------