Email List: Xaustin-group-lX
[All Lists]

RE: XSH/XRAT conflict over cancellation points

To: "'Alexander Terekhov'" <yyyyyyyy@xxxxxxxxxx>
Subject: RE: XSH/XRAT conflict over cancellation points
From: Schwarz Konrad <yyyyyyyyyyyyyy@xxxxxxxxxxx>
Date: Mon, 24 May 2004 09:29:02 +0200
Cc: Dave Butenhof <yyyyyyyyyyyyyy@xxxxxx>, yyyyyyyyyyyyyy@xxxxxxxxxxxxx
> > After pondering the issue some more, I fail to see what impact
> > setjmp()/longjmp() actually have on thread cancellation.
> 
> Thread cleanup handlers can be interleaved with exception 
> handlers. If you have archaic setjmp/longjmp based "C 
> exceptions", you have no practical choice other than use 
> TRY-CATCH{ALL} or TRY-FINALLY for pthread_cleanup_push/pop 
> implementation (two separate stacks make no sense). TRY is 
> nothing but decorated setjmp() and THROW/RETHROW is nothing 
> but decorated longjmp().
> 
> > The cancellation stack is simply a list of routines that must be
> > invoked at certain times.

I understnd that you may want to interleave exception handling with thread
cleanup handlers.  How does that requirement force implementing pushing and
popping cleanup handlers in C to be implemented via setjmp()/longjmp()?

<Prev in Thread] Current Thread [Next in Thread>