in reply to How do I run subroutines in parallel?
I tried the thread thing which does not work. (ActivePerl 5.6-build 62x) Now I use Win32::ProcFarm system for parallelization of code under Win32 by Toby Everett under Artistic licence. This let me start child-processes, which are Perl scripts and and do remote procedure calls over sockets, giving complete Perl data structures as parameters. It is not quit clean yet, but it works nice for me.
Depending on your tasks, parallization is not always a matter of CPUs. My App is a (preforking) server with a fixed number of childs (for now). It accepts mainframe socket connections. My childs are a downloader, which initiates source download from the mainframe via FTP and a preparer, which compiles the downloaded objects. Downloading is a task, which really allows parallel processing of other tasks. Another parallel thing feeds a GUI with status information.
Do not underestimate the coordination of parallel processes, if they do not have isolated tasks.
I do Logging with Log::Agent, this works great for me and I think it is a great module.
Ask me for more information
Update:
As Massyn answered to this post, it makes a great difference on which OS you run parent and child processes. I could not get communication via pipes, files or exit codes to work on Windows. My App depend on a windows product, so I did use a windoze only solution. The anonymous monk did not tell about his plattform.
Brutha
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I run subroutines in parallel?
by Massyn (Hermit) on Sep 10, 2002 at 09:50 UTC |