Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007975]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2018-06-25 18:42 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.