Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
[holli]: but is this really a problem 1nickt? Nobody knows how your human taxi drivers brain works either
[holli]: at least for cars, if the ai works better than a human on average, by all means let the machines drive

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-11-21 13:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (301 votes). Check out past polls.

    Notices?