[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: busyloop in sigchld_handler
From: |
Andreas Schwab |
Subject: |
Re: busyloop in sigchld_handler |
Date: |
Mon, 12 Mar 2007 20:28:33 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) |
Sam Steingold <address@hidden> writes:
> I don't know the details, but the kernel obviously has to do SOMETHING
> when the child process terminates: it has to notice the state change so
> that wait3 in emacs will return "yes, the child is dead" instead of
> "nothing for you yet". The busyloop prevents the kernel from doing
> anything for some time.
But the busyloop does not happen when there is nothing to do, it only
happens when wait3 is interrupted. A zero return will cause the handler
to return immediately.
> Now, it might be better to remove the WNOHANG option instead (except that
> signal handlers are not supposed to hang),
If you don't use WNOHANG you open up a race where several processes may
have their status changed, but only one signal is sent (non-realtime
signals are not queued).
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Re: busyloop in sigchld_handler, (continued)
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/11
- Re: busyloop in sigchld_handler, Kim F. Storm, 2007/03/11
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/12
- Re: busyloop in sigchld_handler, Sam Steingold, 2007/03/12
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/12
- Re: busyloop in sigchld_handler, Sam Steingold, 2007/03/12
- Re: busyloop in sigchld_handler,
Andreas Schwab <=
- Re: busyloop in sigchld_handler, David Kastrup, 2007/03/12
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/12
- Re: busyloop in sigchld_handler, David Kastrup, 2007/03/13
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/13
- Re: busyloop in sigchld_handler, David Kastrup, 2007/03/13
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/13
- Re: busyloop in sigchld_handler, David Kastrup, 2007/03/13
- Re: busyloop in sigchld_handler, Andreas Schwab, 2007/03/13
- Re: busyloop in sigchld_handler, David Kastrup, 2007/03/14
- Re: busyloop in sigchld_handler, Kim F. Storm, 2007/03/14