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

Re^2: Threading Equivalent to this Parallel::ForkManager Example

by BrowserUk (Pope)
on Apr 02, 2014 at 08:00 UTC ( #1080694=note: print w/ replies, xml ) Need Help??


in reply to Re: Threading Equivalent to this Parallel::ForkManager Example
in thread Threading Equivalent to this Parallel::ForkManager Example

This would seem to be an equivalent:

Not so. It is fatally flawed.

Your code is directly equivalent to:

#!/usr/bin/env perl use strict; use warnings; use threads; my $n = 0; while (<DATA>) { print 'Thread ', ++$n, ': ', $_; }

Ie. It exhibits no parallelism whatsoever.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: Threading Equivalent to this Parallel::ForkManager Example
by kcott (Canon) on Apr 02, 2014 at 08:13 UTC

    Thanks for picking that up. I've updated my post.

    -- Ken

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2016-06-27 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (337 votes). Check out past polls.