Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: [Thread::Queue] How to handle unexpected termination and time out in threads

by BrowserUk (Pope)
on Apr 09, 2014 at 14:05 UTC ( #1081653=note: print w/ replies, xml ) Need Help??


in reply to [Thread::Queue] How to handle unexpected termination and time out in threads

So, when a worker thread die unexpectedly, where can I insert code to handle it?

How do you handle it when a non-threaded program might die unexpectedly?

A "non-threaded program", is actually a single-threaded program, and what works in one thread -- the main and only thread -- works just the same in any other thread. So do the same thing.

And, when a worker thread hangs for too long, where in the code can I time it out?

You know what I'm going to say right?

How do you handle this in a single-threaded program?

Do the same thing.


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.


Comment on Re: [Thread::Queue] How to handle unexpected termination and time out in threads

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2015-07-03 21:07 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 (56 votes), past polls