Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Crash with ForkManager on Windows

by Discipulus (Canon)
on Sep 20, 2017 at 21:07 UTC ( [id://1199783]=note: print w/replies, xml ) Need Help??


in reply to Crash with ForkManager on Windows

Hello amitsq,

I'm not at all a parallel monk and here there are, very skilled.

> my $pm= new Parallel::ForkManager(8); #didn’t matter if it’s 1 or 5 or whatever else

your original program crash here too and in the same way, but with 1 does not.

I have borrowed the below modifying it a little from example from P::FM docs and the resulting code runs with no crashes. At least something to start with:

use Parallel::ForkManager; use LWP::Simple; my $pm = Parallel::ForkManager->new(10); LINKS: for my $link ('http://us.a1.yimg.com/us.yimg.com/i/ww/m5v9.gif', 'http://hooboy.no-such-host.int/', 'http://www.yahoo.com', 'http://www.ora.com/ask_tim/graphics/asktim_header_main.gif', 'http://www.guardian.co.uk/', 'http://www.pixunlimited.co.uk/siteheaders/Guardian.gif') { $pm->start and next LINKS; my ($content_type, $document_length, $modified_time, $expires, $ +server) = head($link); print "$link fetched: declared lenght $document_length, \n"; $pm->finish; }; # output http://hooboy.no-such-host.int/ fetched: declared lenght , http://us.a1.yimg.com/us.yimg.com/i/ww/m5v9.gif fetched: declared leng +ht 5611, http://www.guardian.co.uk/ fetched: declared lenght 628397, http://www.ora.com/ask_tim/graphics/asktim_header_main.gif fetched: de +clared lenght , http://www.pixunlimited.co.uk/siteheaders/Guardian.gif fetched: declar +ed lenght , http://www.yahoo.com fetched: declared lenght 12,

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Crash with ForkManager on Windows
by amitsq (Beadle) on Sep 21, 2017 at 09:53 UTC

    i tried your reduced code, 100% copy - no change and it crashes. I might run it 20 times with no crashes, but then the crashes happened like before.

    Even once i got a very strange error message on the terminal:
    http://us.a1.yimg.com/us.yimg.com/i/ww/m5v9.gif 1354074654, Number found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 13, near "over 4" (Do you need to predeclare over?) Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 16. Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 17, near "<GLOB_NOSORT> is" (Missing operator before is?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 18, near ") rather" (Missing operator before rather?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 24, near ") returns" (Missing operator before returns?) Can't locate object method "_init_implementor" via package "URI::http" + at D:/Perl64/lib/URI.pm line 137. Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 25, near "&File::Glob::GLOB_ERROR will" (Missing operator before will?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 26, near "&File::Glob::GLOB_ERROR is" (Missing operator before is?) Number found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 29, near "over 4" (Do you need to predeclare over?) Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 32. Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 36. Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 41, near ") has" (Missing operator before has?) Operator or semicolon missing before &File::Glob::ERROR at D:/Perl64/l +ib/File/Glob.pm line 43. Ambiguous use of & resolved as operator & at D:/Perl64/lib/File/Glob.p +m line 43. Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 45, near ") deviates" (Missing operator before deviates?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 45, near ") behaviour" (Missing operator before behaviour?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 46, near ") will" (Missing operator before will?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 47, near "continue processing" (Do you need to predeclare continue?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 47, near "<GLOB_ERR> flag" (Missing operator before flag?) Number found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 54, near "over 4" (Do you need to predeclare over?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 60, near ") isn't" (Missing operator before isn't?) Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 66. Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 67, near "use of backslash" (Do you need to predeclare use?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 68, near ") solution" (Missing operator before solution?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 68, near "use forward slashes" (Do you need to predeclare use?) String found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 70, near "match "normal practice"" (Do you need to predeclare match?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 70, near ""normal practice" on" (Missing operator before on?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 71, near ") only" (Missing operator before only?) String found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 72, near "metacharacters '['" (Do you need to predeclare metacharacters?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 77, near "use the real" (Do you need to predeclare use?) Array found where operator expected at D:/Perl64/lib/File/Glob.pm line + 89, at end of line Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 90. Array found where operator expected at D:/Perl64/lib/File/Glob.pm line + 91, at end of line Array found where operator expected at D:/Perl64/lib/File/Glob.pm line + 92, at end of line Array found where operator expected at D:/Perl64/lib/File/Glob.pm line + 93, at end of line Semicolon seems to be missing at D:/Perl64/lib/File/Glob.pm line 93. Number found where operator expected at D:/Perl64/lib/File/Glob.pm lin +e 96, near ") 1989" (Missing operator before 1989?) Bareword found where operator expected at D:/Perl64/lib/File/Glob.pm l +ine 96, near "1993 The"
    No idea where that pop up from. It only happened once in all the times trying.

      When seeing errors (Bareword found where operator expected), try pre-loading the module before running parallel. See, this post.

      use LWP::Simple; # On the Windows platform, pre-loading essential modules # (required at runtime) may be necessary for extra stability. if ( $INC{'LWP/UserAgent.pm'} && !$INC{'Net/HTTP.pm'} ) { require IO::Handle; require Net::HTTP; require Net::HTTPS; } # run parallel ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1199783]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-25 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found