Thanks to all who responded and pointed me in the right direction. However, my research yielded a lot of conflicting information regarding threading and forking in perl. Basically, threading doesn't work very well, at least not on 5.6.1 638. And forking isn't implemented very well on Win32, according to various sources. It seems that forking is best done on the *nix platforms. In any case, since I don't have all the needed time to study this in length, I've decided to do what I like to call "poor man's" multi-threading. I split up my script into 3 scripts, each doing the same but writing to a different output file. I then "start" each one of them from a batch file so that they run in parallel. Once they're all done, I just copy the output files together into one. This has reduced my run time from 90 minutes to under 30 minutes. I know this isn't the most graceful way to multi-thread a script, but with my limited knowledge this is the best I can come up with within my time constraints. I hope this helps out others, and if anyone can find an authoritative threading or forking how-to for Win32, please don't hesitate to post it here. Thanks. -Henry
-----Original Message----- From: Craig Dayton [mailto:[EMAIL PROTECTED] Sent: Tue 8/17/2004 9:55 PM To: henry isham; [EMAIL PROTECTED] Cc: Subject: RE: Threading 101 Henry, Read the Perl documentation for more background on ithreads. ('perldoc perlthrtut'). One solution could be to declare a global Thread::Queue. The worker threads would input data into the queue and the parent thread would pull data records out of the queue and write it to a file. The worker threads will need a locking mechanism around the queue insert part. This solution is likely only viable when the worker threads are doing a limited amount of inserts into the queue. -Craig >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On >Behalf Of henry isham >Sent: Tuesday, August 17, 2004 13:24 >To: [EMAIL PROTECTED] >Subject: FW: Threading 101 > > >Hi all, > >I have a script with multiple subs that are independent of >each other and can run simultaneously. So, I'm thinking of >threading them. However, each sub writes output to the same >file. Now, they run sequentially, so that isn't a problem. >What considerations should I keep in mind when threading these >subs? Should I just have them output to separate text files >and then consolidate those files before my parsing starts? Or >is there a way to have all the threads write to the same file >without stepping on each other's output? > >Thanks in advance for any and all help. > >-Henry > > > > > >_______________________________________________ >Perl-Win32-Admin mailing list [EMAIL PROTECTED] >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs