trapping signals in a multithreaded environment
问题 I have a large program that needs to be made as resilient as possible, and has a large number of threads. I need to catch all signals SIGBUS SIGSEGV , and re-initialize the problem thread if necessary, or disable the thread to continue with reduced functionality. My first thought is to do a setjump , and then set signal handlers, that can log the problem, and then do a longjump back to a recovery point in the thread. There is the issue that the signal handler would need to determine which