in reply to Re: Fork and wait question
in thread Fork and wait question
my $fh = $pids{$key}{'fh'}; while (<$fh>){print $_}
This kind of thing will work fine until your sub-processes need to produce more than 4k of data (or whatever your buffer size is). Then the sub-procs will block when they print() and won't work in parallel while you're collecting results. To fix this you need to switch to using something like IO::Select or EV to pull data from each process as it's ready.
-sam
|
---|