Welcome to the Monastery | |
PerlMonks |
Re: Crash with ForkManager on Windowsby kcott (Archbishop) |
on Sep 21, 2017 at 08:45 UTC ( [id://1199811]=note: print w/replies, xml ) | Need Help?? |
G'day amitsq, I suspect your problems are related to the additional $pm->finish and next statements. Your instantiation of the Parallel::ForkManager object may also be an issue. What you have is different from every example shown in the documentation; also see "perlobj: Invoking Class Methods" (including its "Indirect Object Syntax" subsection). Using exactly the same message to identify your different cases is pointless: use meaningful messages. I rewrote your code like this (pm_1199760_parallel_forkmgr_link_checker.pl):
Here's the output with no argument:
I then ran it with arguments of 8, 5, 3, 2 and 1. Lke the first run (with no argument), all ran to completion: no crashes! With the exception of 1, they produced the same results (although the order of output varied). Running with an argument of 1 rather defeats the purpose of running processes in parallel; however, as you said you'd used it, I tried it also. Here's what I got:
I ran that a second time: the result was the same. I'll leave you to investigate that further. — Ken
In Section
Seekers of Perl Wisdom
|
|