Parallel::ForkManager not working as intended on Windows Server 2003

C

chaitu

Hi folks,

I've created a perl module MakeCVSStructure in which I've coded 2
functions called CheckoutAllSubDirs and CheckoutSubDir respectively.
This module and its functions are intended to help me maintain my CVS
working copies.

In MakeCVSStructure.pm:
--------------------------------------

use Parallel::ForkManager;

....bla bla...some more functions go here...

sub CheckoutSubDir
{
my $self = shift;
my $sub_dir_name = shift;
chdir $self->{TOPDIR};
$ENV{CVSROOT}=<The value goes here...it's confidential...>;
system("cvs -q checkout -r $self->{TAG} -P $sub_dir_name");
print "\nCVS Checkout of module $sub_dir_name successful!\n" if $? ==
0;
}

sub CheckoutAllSubDirs
{
# The subdirs need to be checked out in a parallel fashion!
# Code goes here...
my $self = shift;
my $sub_dir_list = $self->{SUBDIRLIST};
my $no_of_subdirs = @$sub_dir_list;
print "\nNo. of subdirectories = $no_of_subdirs\n";

my $pm = new Parallel::ForkManager();

foreach my $subdir (@$sub_dir_list)
{
print "\nSpawning $subdir now...\n";
$pm->start and next;

print "\nInside child process for $subdir now...\n";
$self->CheckoutSubDir($subdir);
$pm->finish;

}
$pm->wait_all_children;
}

When I create an object of this class in my .pl file and run the .pl
file as follows, it does NOT start parallel checkouts of the CVS
modules, but goes in a serial fashion.....

Code of my .pl :
------------------------

use MakeCVSStructure;

my $sub_dir_list =
["admin","build","host","server","thirdparty","tools"];
my ($drive, $topdirname, $tag) = @ARGV;

my $MyCVSObj = MakeCVSStructure->new();
$MyCVSObj->SetTopDir("${drive}:\\${topdirname}");
$MyCVSObj->SetTag("$tag");
$MyCVSObj->SetSubDirList($sub_dir_list);
$MyCVSObj->GetDetails;
$MyCVSObj->MakeTopDir;
$MyCVSObj->CheckoutAllSubDirs;

Could the gurus please tell me why the checkouts aren't happening in a
parallel fashion as I expected them to?

Thnx a million for the help...
 
X

xhoster

chaitu said:
Hi folks,

I've created a perl module MakeCVSStructure in which I've coded 2
functions called CheckoutAllSubDirs and CheckoutSubDir respectively.
This module and its functions are intended to help me maintain my CVS
working copies.

my $pm = new Parallel::ForkManager();
^^

What do you think this accomplishes?


Xho
 
C

chaitu

Hi there,

I guess I was braindead for sometime.....thanks a lot! I was feverish
last evening when I was forced into coding this......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top