Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to use Threads

by trwww (Priest)
on Jan 09, 2011 at 04:38 UTC ( #881325=note: print w/ replies, xml ) Need Help??


in reply to How to use Threads

Your operating system is already multithreaded. Your task would be easier suited to using that than the in-language thread support:

opendir(DIR, $directoryLocation); my @files = grep(/\.html$/,readdir(DIR)); closedir(DIR); my @cmd = qw( start perl c:/html2wordxml.pl ); foreach my $file ( @files ) { system( @cmd => $file ); }

In other words, make a program that knows how to reformat a single file, and then call that program repeatedly without waiting for the last call to finish.


Comment on Re: How to use Threads
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://881325]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-05 08:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls