setjmp/longjmp

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Nov 1 21:41:22 AEST 1984


David Marx posted a nice article about the problems with longjmp'ing
from a signal handler on PDP-11s.  The problem is not quite so bad
on systems with atomic linkage sequences but it is still tricky.

This study reinforces a conclusion I drew long ago:  About all one
should do in response to an asynchronous trap is to set a flag for
periodic testing from the main program loop.  (That gives one MUCH
better control over program internal operation.)  It makes one wonder
what good longjmp is after all...

That was the only article so far that inclines me to surrender the
desire for specifying clean longjmp semantics.  There is not much
point in insisting on that if it is unrealizable.



More information about the Comp.lang.c mailing list