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.
|
|---|