in reply to Thread parallel execution
Did you read about what join does? It blocks. Try
use threads; my $thr = threads->create ( sub { for (5..10) { print $_,"\n"; sleep(1);}}); my $thr2 = threads->create ( sub { for (10..19) { print $_,"\n";}}); $thr2->join(); $thr->join();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Thread parallel execution (joinable)
by Anonymous Monk on May 08, 2013 at 02:26 UTC | |
Re^2: Thread parallel execution (join blocks)
by arunbhargav (Novice) on May 08, 2013 at 03:03 UTC | |
by BrowserUk (Patriarch) on May 08, 2013 at 08:47 UTC |