(Jorge) wrote in message news:<. com>...
> All,
>
> I've got a process that creates some children and want to be alerted
> when they die. To do this, the SIGCHLD signal is registered in the
> process using sigaction to jump to a subprogram as soon as it's
> received.
>
> The problem comes when many children exit at the same time and their
> father seems to miss some of them. This happens quite often, but not
> always.
>
I noticed this problem on linux using the sigqueue function. I was
writing
in C. On Solaris, I never missed signals.
I don't think you can consider signals reliable. Some of them
will be dropped. I went looking through the linux source a while ago
trying to figure out why. It looked like the kernel would skip
delivering a signal if the task struct for the process already had
that same signal marked for delivery on the process. So, if 2 signals
were delivered before the first was handled, the process would only
know
1 signal was delivered. Perhpas HPUX is similar.
Here is a thread where I was writing about this:
(I don't think I explained it too well then and I still dont know if I
was
right)
http://cboard.cprogramming.com/showt...sigqueue+linux
You might want to do periodic checks of the pids you know you started,
using the non-blocking version of waitpid.
> Why are the signals being missed? I'm pretty sure it's something with
> the flags on sigaction, but I've tryed several options and it's always
> the same.
>
If you really want to explore this, you should check with people in
comp.unix.programmer, etc....
> I appreciate your suggestions. Thanks in advance.
>
> PS: Perl 2.5.1, hpux 11.00
You are joking about perl 2.5.1 right? How old would that be?
<snip code>