Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: removing all threads..

by BrowserUk (Pope)
on Dec 09, 2012 at 12:47 UTC ( #1007975=note: print w/ replies, xml ) Need Help??


in reply to removing all threads..

You could add $_->join for threads::list(); just before the program ends; but it will require the threads to terminate before the program will end.

Alternatively, if you do not care to wait for the threads to complete; detach the threads, either when you create them:

threads->new( ... )->detach;

Or just before you exit the program:

$_->detach for threads::list(); sleep 1; exit;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re: removing all threads..
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2014-08-27 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls