krish1982 has asked for the wisdom of the Perl Monks concerning the following question:
The same code is executing with out parallel processing. What is the issue? How to resolve is this?use Parallel::ForkManager; my $pm = new Parallel::ForkManager(50); my $db = krish::DB->new or die $!; # its has all connection details while ( $low < $high ) { # Some value manipulation my $pid = $pm->start and next; #db_execution returns execution while ( my $sth = db_execution ( $db, $low , $high ) ) { ... #fetch row operation ... } $pm->finish; } sub db_execution { ... my $dbh = $db->connect( 'students' ) or die $!; my $sth = $dbh->prepare( $sql ) or die "$!:" . $dbh->errstr; $sth->execute or die "$!:" . $sth->errstr; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parllel Processing Database Query
by psini (Deacon) on Jul 28, 2009 at 11:35 UTC | |
|
Re: Parllel Processing Database Query
by roboticus (Chancellor) on Jul 28, 2009 at 12:19 UTC | |
by ctilmes (Vicar) on Jul 28, 2009 at 12:55 UTC | |
by metaperl (Curate) on Jul 28, 2009 at 13:59 UTC | |
|
Re: Parllel Processing Database Query
by dont_you (Hermit) on Jul 29, 2009 at 06:58 UTC | |
by whakka (Hermit) on Jul 29, 2009 at 13:31 UTC |