> I'm writing a Perl program to run on Windows platforms (Win2K and 
> WinXP). whose job is to manage concurrent downloads using libwww-perl 
> (LWP). The basic model is that a manager process checks continuously 
> against a task list (actually a directory containing task files) and 
> launches a sub-process or thread to handle each download. Because the 
> downloads are expected to run concurrently, the manager doesn't wait 
> for the sub-processes to complete.

<snip>

> Has anyone had any experience in writing multi-threaded processes on 
> Windows using libwww-perl? Is it possible to do this stably, or is 
> multi-threading in Windows Perl not yet mature enough? Or, 
> alternatively, am I making some fundamental error in the way I'm 
> going about this?

Hi Angus,

One method that works well for me is to start a fixed number of worker
threads when you script starts, then feed jobs to them from your main
thread. This speeds things up because you don't get the overhead of
cloning the interpreter over and over during your script runtime. Not
sure if this model would work for you - you could fire 10 threads in
your first few lines of code then feed download tasks to them via a
Thread::Queue or somesuch.

Paul

*****************************************************************
Gloucester Research Limited believes the information 
provided herein is reliable. While every care has been 
taken to ensure accuracy, the information is furnished 
to the recipients with no warranty as to the completeness 
and accuracy of its contents and on condition that any 
errors or omissions shall not be made the basis for any 
claim, demand or cause for action.
*****************************************************************


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to