Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Date: Sun, 16 Sep 2001 01:39:32 -0400 From: Christopher Faylor To: cygwin-developers AT cygwin DOT com Subject: Re: possible explanation for make hang Message-ID: <20010916013932.A30789@redhat.com> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20010915234433 DOT A30407 AT redhat DOT com> <009601c13e6d$c4466670$0200a8c0 AT lifelesswks> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <009601c13e6d$c4466670$0200a8c0@lifelesswks> User-Agent: Mutt/1.3.21i On Sun, Sep 16, 2001 at 03:09:29PM +1000, Robert Collins wrote: >----- Original Message ----- >From: "Christopher Faylor" >To: >Sent: Sunday, September 16, 2001 1:44 PM >Subject: possible explanation for make hang > > >> I don't know precisely what make is doing but it is possible that >> if more than one program is attempting to read from the same pipe >> there will be a race that will cause cygwin to block in an >uninterruptible >> read. So, if something like a SIGCHLD comes in while cygwin is >reading >> a pipe it won't be possible to deal with it. I'm not aware of any >> way to interrupt a blocking read on a pipe so cygwin will hang until >> something shows up on the pipe. > >Can we wait on the pipe and a signal event? >Ie >== >HANDLE handles[2]; >handles[0] = signalevent; >handles[1] = pipe; >dword rc = WaitForMultipleObjects (2, handles, FALSE, INFINITE); >if ((rc - WAIT_OBJECT_0) == 1) > ReadFile (pipe); >else > handle_signal; > /* the pipe may also have data, but can check again once the signal is >handled*/ >== You can't normally use WFMO for file handles. I actually tried this an hour or so ago to see if maybe it actually worked on Windows 95. It doesn't. >> I thought I had a promising lead a few weeks ago but the Windows API >> stood staunchly in my path, as usual. > >What was that? Perhaps a brain storm could find something? Someone on the cygwin mailing list suggested just closing the pipe handle in another thread as a way of forcing the read to return. Unfortunately, the CloseHandle blocks when you do this. I had another brainstorm that maybe if I deallocated the memory for the buffer being used in the ReadFile, it would return. Nope. cgf