Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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]
[1nickt]: That's cool Disci+

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-01-24 03:02 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (255 votes). Check out past polls.