[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Exception handling
That's NOT how setjmp/longjmp are implemented! setjmp caches
away some registers, and longjmp reloads them - that's about it. No
operating system intervention, let alone signal handling, is needed.
In fact, 754R throw can be implemented with setjmp/longjmp (or perhaps
better with something like sigsetjmp/siglongjmp) if the alternate
handlings are stored in a table (or perhaps a stack) and exception
detection is done synchronously with flags at the end of the alternate
exception block. That might be the least inefficient solution on
systems which make asynchronous signaling expensive.
But I think the design intent is that the hardware provide an efficient
way to regain local control after an exception.