Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Threads: How to kill a thread manually?

by Elian (Parson)
on Apr 26, 2005 at 18:35 UTC ( #451719=note: print w/ replies, xml ) Need Help??


in reply to Threads: How to kill a thread manually?

You can't kill threads, on purpose -- it's horribly dangerous and pretty much guaranteed to corrupt internal state. Not good.

What you want is to have thread 1 check the state of thread 2 occasionally and cleanly exit when it's done. (Or, if you just want to completely kill the process, have thread 2 do a hard exit, but that'll not run DESTROY methods and such, which is probably not what you want)


Comment on Re: Threads: How to kill a thread manually?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-04 02:04 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 (57 votes), past polls