How to use try/catch/throw to recover from a signal

How to use try/catch/throw to recover from a signal

Post by Vi Thuan Ban » Tue, 27 Aug 1996 04:00:00



When a signal is sent to a process, how do you use
try/catch/throw to recover from a signal handler.  I read in the
C++ faq that using setjmp() and longjmp() is not good.

 
 
 

How to use try/catch/throw to recover from a signal

Post by Joe Halp » Tue, 27 Aug 1996 04:00:00



Quote:>When a signal is sent to a process, how do you use
>try/catch/throw to recover from a signal handler.  I read in the
>C++ faq that using setjmp() and longjmp() is not good.

You can't use C++ exceptions to recover from a signal. Exceptions in
C++ are synchronous, and signals are asynchronous. You have to
deliberately throw an exception, but you don't have to do anything to
get a signal.

Joe