in reply to Re^4: Fork vs pThreads
in thread Fork vs pThreads
Change your code to:
my $pm = Parallel::ForkManager->new(4); my $i = 0; while(i<50){ $pm->start and next; processStream($stream); $i++; $pm->finish; # do the exit in the child process } $pm->wait_all_children();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Fork vs pThreads
by ThelmaJay (Novice) on Oct 21, 2013 at 15:25 UTC |