in reply to Re: SIG CHLD IGNORE and wait at same time
in thread SIG CHLD IGNORE and wait at same time
Try swapping those two statements, for a start.No, it did not help.
You have a race condition in your parent code:I don't think it was race condition in this case, because this code should work with and without SIG CHLD IGNORE statement.
IGNORE' is most useful when you really don't care.Well, for example I want to reap zombies while program run, but at the same time I want to wait all child processes at exit.
I'd recommend just using your own wait() or waitpid() loop, perhaps in conjunction with a custom signal handler if you need out-of-band child exit notifications.Yes, as I told, this fixes problem:
so probably there is a workaround.$SIG{CHLD} = sub { while( wait() != -1 ){ print STDERR "wait0\n"}; };
usually returns -1Yes, indeed. Ok, thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: SIG CHLD IGNORE and wait at same time
by rjt (Curate) on Aug 04, 2013 at 03:47 UTC | |
by vsespb (Chaplain) on Aug 04, 2013 at 10:16 UTC | |
by rjt (Curate) on Aug 04, 2013 at 11:21 UTC |