Perl will only call a particular signal handler once per signal number - no matter how many times it recieves that signal type *before* handling it.
But there's a general flaw with your stress code; you have multiple processes all writing to stdout (which I presume is redirected to a file), and that's likely to lose or duplicate output, even with $|=1:
$ cat /tmp/p1
#!/usr/bin/perl
$| = 1;
for (1..10) {
if (fork == 0) {
print "$_\n" for 1..100;
exit;
}
}
$ perl588 /tmp/p1 > /tmp/x ; wc -l /tmp/x
900 /tmp/x
$ perl588 /tmp/p1 > /tmp/x ; wc -l /tmp/x
983 /tmp/x
$ perl588 /tmp/p1 > /tmp/x ; wc -l /tmp/x
1000 /tmp/x
Either open the file in append mode and only syswrite to it,
or have each process write to a separate file.
Dave.