Hi - > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Steve > Slaughter > Sent: Thursday, January 23, 2003 9:25 AM > To: [EMAIL PROTECTED] > Subject: Problem with Threads > > > I am setting up threads to process an array of files in each element of an > array of folders. Several computers will be executing an application that > will process divvied up files across the network. The first iteration > through the first folder runs great but when the program loops to the next > folder and starts loading files into the queue again it crashes and > generates the error "Perl.exe has generated errors and the > program has been > terminated" etc. > > Below is the code generating the error. Any help would be most > appreciated. > BTW, W2K. Thanks. > > > foreach $folders (@folders){ > ($fold1, $fold2)=split(/\./, $folders); > > my $root="C:\\rootfolder\\"; > $fold1 =~ s!/!\\!g; > $runfolder = $root . $fold1; > > chdir "$runfolder" or die ("Could not change to > $runfolder. $!"); > opendir (THISDIR, "."); > @thefiles = grep /\.ext$/, readdir THISDIR; > closedir THISDIR; > > print "Preparing to run program in : $runfolder\n"; > print "Please wait, this could take some time.\n"; > > (((this is the last line to print before the error message))) > > > # Fill the queue > foreach $file (@thefiles) { > $Q->enqueue($file); > } > > # Local thread > my $thrA = threads->new(sub { > > > etc.... > I have just implemented (sucessfully) a server using threads (ActivePerl 5.8.0 (804) on Win2K). I would be happy to try to help, but I need nore information:
* perl version * more detail on your script: Who dequeues? Where is Q? How many threads will run? Are they 'straight' or 'detached'? What is 'main' doing while all this happens (waiting on 'join')? * can you trim your script down to the simplest form that fails and post it? (or attach it to me?) Aloha => Beau. _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
