pthread_cancel and EH: let's try this again

Alexander Terekhov terekhov at web.de
Mon Jul 18 08:57:30 UTC 2005


Nathan Myers wrote:
> 
> On Mon, Jul 18, 2005 at 02:15:35AM +0300, Peter Dimov wrote:
> > Nathan Myers wrote:
> >
> > >2. Existing thread-safe and exception-safe C and C++ libraries that do
> > >*not* take cancellation into account should still work.
> >
> > Even when cancelled?
> 
> Of course.  Otherwise what's the point? [... ECANCELED ...]

That's impossible. At best, existing cancel-unaware "thread-safe" 
C++ library will throw "internal errors" from its ctors and simply
swallow (if not abort() due to unexpected error) cancel requests 
that happen to hit its dtors (undesirable delivery at really-no-
cancel points/regions with or without silly stickiness aside for 
a moment). You're trying to solve unsolvable. Cancel-unaware code 
is simply meant to be run with cancellation disabled.

regards,
alexander.




More information about the c++-pthreads mailing list