arunbhargav has asked for the wisdom of the Perl Monks concerning the following question:
I see that the above code produces the following o/p which has nuthing to do with parallel run, what am i missing here?use threads; my $thr = threads->create ( sub { for (5..10) { print $_,"\n"; sleep(10);}}); $thr->join(); my $thr2 = threads->create ( sub { for (10..19) { print $_,"\n";}}); $thr2->join();
i was anticipating garbled output , not a sequential one5 6 7 8 9 10 10 11 12 13 14 15 16 17 18 19
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Thread parallel execution (join blocks)
by Anonymous Monk on May 08, 2013 at 02:17 UTC | |
by Anonymous Monk on May 08, 2013 at 02:26 UTC | |
by arunbhargav (Novice) on May 08, 2013 at 03:03 UTC | |
by BrowserUk (Patriarch) on May 08, 2013 at 08:47 UTC |