in reply to Re^5: Setting signal handlers
in thread Setting signal handlers
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:
Either open the file in append mode and only syswrite to it, or have each process write to a separate file.$ 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
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Setting signal handlers
by sgt (Deacon) on May 11, 2006 at 22:24 UTC |