in reply to Runing "regular" code with threaded perl
The problem is not with threading. If your program is written to use threads, you won't be able to run it on a version Perl without threads. If your program is not written to use threads, Perl won't use threads and all the concurrency problems you have come from other sources.
It seems to me that your program is launching multiple external programs but is not properly synchronizing them. Without seeing the relevant code, it's hard to tell where your program goes wrong. I recommend looking at Parallell::ForkManager or at the simple runN by Dominus. Both approaches are discussed in Parallelization of heterogenous (runs itself Fortran executables) code.
If you want/need to roll your own parallelisation, I recommend having one or more "queues" into which you put the jobs. Your master program then launches the subprograms to process the jobs in the queues and hopefully has simple enough logic to determine when a job in a queue further down below can be started.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Runing "regular" code with threaded perl
by kingskot (Sexton) on Jul 10, 2008 at 07:09 UTC | |
by pc88mxer (Vicar) on Jul 10, 2008 at 07:14 UTC |