monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] auto updates


From: Nuno Lucas
Subject: Re: [Monotone-devel] auto updates
Date: Mon, 30 Oct 2006 01:15:15 +0000

On 10/30/06, Nathaniel Smith <address@hidden> wrote:
On Sun, Oct 29, 2006 at 09:13:15AM +0000, Nuno Lucas wrote:
> Just do this for POSIX systems (I don't believe there is a problem
> with zombie processes on other systems):
>
> static void signal_handler( int sig, siginfo_t* si, void * context )
> {
>   int status;
>   wait (&status);
> }

FYI, this is a bit buggy -- it can leave zombies if signals get
coalesced, or freeze if other processes might call wait() before the
signal handler runs.

That is new to me. I got that code on some book on advanced unix
programming and that's what I use in my programs (if I want to wait
for a program, I just use system() and WEXITSTATUS). Have to find that
book again...

Always hated unix signals because of their racy conditions and stupid
behaviours. This just adds to my global feeling...

But this technique is what I meant by "unconditionally get rid of
zombies" -- I'm not sure what happens when you have a signal handler
like this, _and_ you sometimes want to call waitpid() in your program
explicitly.

Well, you can disable the signal when you do it. But my dislike for
signals and now knowing I got it wrong the first time doesn't let me
add more.


Best regards,
~Nuno Lucas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]