I have a process that one of its background threads (Thread-A
) does a task. If the process hangs/crashes, I want to make sure that the background thread crashes/stops as well (ok for me).
What I mean is I don't want to be in a situation where some of the threads are crashed and so the process essentially is non-functional and that background thread (Thread-A
) keeps going.
I need to somehow make that thread understand the problem.
Is there a pattern for this? Some kind of health check may be? Still though how can I be sure I don't get the same problem with the health check thread.
Perhaps I am confused on this. Could you please help me out?