pplshlp has asked for the wisdom of the Perl Monks concerning the following question:
Can someone please help? Is there anything that I have to add/modify? Thanks#!/usr/bin/perl use strict; use warnings; use threads; use threads::shared; print "Starting main program\n"; my @threads; for ( my $count = 1; $count <= 10;$count++) { my $t = threads->new(\&sub1); push(@threads,$t); } foreach (@threads) { $_->join; } print "End of main program\n"; sub sub1 { //do something }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Concurrent execution of threads
by kcott (Archbishop) on Nov 29, 2012 at 06:46 UTC | |
by pplshlp (Initiate) on Nov 29, 2012 at 09:29 UTC |