Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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.


Comment on Re^2: Threading Equivalent to this Parallel::ForkManager Example
Download Code
Re^3: Threading Equivalent to this Parallel::ForkManager Example
by kcott (Abbot) 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 scrutinizing the Monastery: (3)
As of 2014-09-19 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls