in reply to Proc::Queue problem

You don't want to parallelize your main tasks so, don't fork on your main loop and ensure that no children are running at the end of every iteration:
use Proc::Queue size => 5; for (1..20) { # you don't want to fork here!!! do_task($_); 1 while wait != -1; }

Replies are listed 'Best First'.
Re^2: Proc::Queue problem
by afresh1 (Hermit) on Oct 24, 2008 at 01:57 UTC

    I took it that he wanted to parallize several sub-tasks, like

    foreach (@subtask1) { fork; # do subtask1 } wait; # for all subtasks to finish foreach (@subtask2) { fork; # do subtask2 } wait; # for all subtasks to finish repeat for subtaskX
    l8rZ,
    --
    andrew