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.
In reply to Re^2: SIG CHLD IGNORE and wait at same time
by vsespb
in thread SIG CHLD IGNORE and wait at same time
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |