Re: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-15 Thread Volker Stolz
In local.glasgow-haskell-bugs, you wrote: Am 10. Jul 2002 um 22:21 CEST schrieb Dean Herington: The first issue I confronted is that the get*ProcessStatus routines return an error rather than nothing if there is no candidate child process. Yes, `waitpid' might return with EINTR which will

Re: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-15 Thread Dean Herington
Volker Stolz wrote: In local.glasgow-haskell-bugs, you wrote: Am 10. Jul 2002 um 22:21 CEST schrieb Dean Herington: The first issue I confronted is that the get*ProcessStatus routines return an error rather than nothing if there is no candidate child process. Yes, `waitpid' might

RE: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-11 Thread Simon Marlow
I had thought of having the signal handler reap as many terminated child processes as possible, but had been concerned about a possible race condition. After you suggested that approach, I thought some more and decided that no race problem should exist. So I've implemented multiple

RE: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-10 Thread Simon Marlow
The fine points of Unix signal semantics have always been somewhat mysterious to me. However, after digging around in man pages for a while, I have a theory as to what's going wrong... Yes, your diagnosis looks very plausible. The right way, I believe, to handle this in your signal

Re: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-10 Thread Dean Herington
Simon Marlow wrote: The fine points of Unix signal semantics have always been somewhat mysterious to me. However, after digging around in man pages for a while, I have a theory as to what's going wrong... Yes, your diagnosis looks very plausible. The right way, I believe, to handle

RE: sigCHLD signal handling (Was: Re: pipes? threadWaitRead?)

2002-07-09 Thread Simon Marlow
After much study I have a new theory. It appears that the pipe machinery is working fine, but that sometimes my program fails to reap all of its terminated child processes. I'm using a `sigCHLD` signal handler that does `getAnyProcessStatus True False` each time it's invoked. It