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 (Archbishop) on Apr 02, 2014 at 08:13 UTC

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

    -- Ken