Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Things you need to know before programming Perl ithreads

by liz (Monsignor)
on Aug 31, 2003 at 18:18 UTC ( #288049=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use threads ();
    use threads::shared ();
    ...
    push( @thread,threads->new( sub { $scalar++ for 1..100000 } ) ) for 1.
    +.10;
    $_->join foreach @thread; # wait for all threads to finish 
    print "scalar = $scalar\n";
    
  2. or download this
    use threads ();
    use threads::shared ();
    ...
    } ) ) for 1..10;
    $_->join foreach @thread; # wait for all threads to finish
    print "scalar = $scalar\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://288049]
help
Chatterbox?
[Discipulus]: thanks hippo! the hat you passed me was brand new and clean, thanks
LanX OS builds on multitasking humor ...
[LanX]: ... next release comes with even more random puns!

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-07-28 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (426 votes). Check out past polls.