Syntactic Confectionery Delight | |
PerlMonks |
Re: How to terminate threads that hang or never return?by zentara (Archbishop) |
on Jun 02, 2006 at 16:21 UTC ( [id://553330]=note: print w/replies, xml ) | Need Help?? |
The problem that we keep encountering is that randomly the threads hang or never return. For a thread to be joinable, it must "return" from it's code block with a return statement, OR reach the end of the code block. Since you didn't show how you wrote &somefunction, I can only generalize. or maybe alarm? You can also try to detach the thread, and have it set a shared variable when it successfully completes. Then loop through the shared flags at the end of your main thread, and kill hanging threads. I'm not really a human, but I play one on earth. flash japh
In Section
Seekers of Perl Wisdom
|
|