On 20-Jul-04, at 3:33 PM, Tsuyoshi SASAMOTO wrote:

Please refer to this discussion about thread safety of setjmp/longjmp:
http://groups.google.com/groups? [EMAIL PROTECTED]


The signal-to-noise ratio in that thread is very low :)

It is clear that setjmp/longjmp are *not* signal-safe; furthermore, signals interact badly with threads. It is certainly not ok to use longjmp in a signal handler, since there is no way of knowing which thread a signal handler might be running in. This does not make setjmp/longjmp thread unsafe (IMHO).

As Posix memorably states, using longjmp with a jump buffer from a different thread context is a "questionable practice ... not worthy of standardization".

R.



Reply via email to