httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rici Lake <ricil...@speedy.com.pe>
Subject Re: [patch] perchild.c (Re: setjmp/longjmp vs try/throw/catch)
Date Tue, 20 Jul 2004 21:29:47 GMT

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? 
> threadm=9vg2ai$iie$1@engnews2.Eng.Sun.COM


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.


Mime
View raw message