Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Program Design Around Threads

by BrowserUk (Pope)
on Mar 06, 2013 at 18:48 UTC ( #1022064=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for my $machine ( @machines ) {
        open my $out, '>', "$machine.dat" or die $!;
    ...
        }
        close $out;
    }
    
  2. or download this
    for my $machine ( @machines ) {
        async {
    ...
            close $out;
        }->detach;
    }
    
  3. or download this
    my $running :shared = 0;             ## This tracks the number of conc
    +urrent threads
    for my $machine ( @machines ) {
    ...
    }
    
    sleep 1 while $running;     ## Make sure the main threads waits for th
    +e last few threads to finish
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-07-02 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls