From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45219fb00709061340t2f0f027ewd34ff976ef8392db@mail.gmail.com> Date: Thu, 6 Sep 2007 22:40:21 +0200 From: "=?ISO-8859-1?Q?Llu=EDs_Batlle?=" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Pipes on UNIX In-Reply-To: <4bddb19f76168d998a8085d9554d3b48@quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45219fb00709061317x594e82a6vb43d136767f245ab@mail.gmail.com> <4bddb19f76168d998a8085d9554d3b48@quanstro.net> Topicbox-Message-UUID: b9f6e46c-ead2-11e9-9d60-3106f5b1d025 2007/9/6, erik quanstrom : > > Therefore, if I had a CGI similar to 'cat' (and I have), it would > > deadlock due to the pipe_process2 not being read by apache if it gets > > filled, the process blocks, and then pipe_process1 gets filled. > > no, you wouldn't. > > i believe the problem is the cgi and apache disagree on the termination > condition. make sure you close the fd 0 when you are done reading. I used gdb, and my process doesn't reach at all the end of reading. It gets blocked writting to stdout. The system input TCP queue to apache is still filled with 70KB of data in the test I did. And the browser didn't receive any byte. And I know my program processed an amount of data (it makes the hard disk pain a bit, so I can 'hear' when it does something).