Subj : Re: pthread function behavior in C++ program To : comp.programming.threads From : Peter Dimov Date : Sun Jun 12 2005 03:25 pm Torsten Robitzki wrote: >> It's better because it's only one step from the "right thing". They >> only need to re-cancel (not rethrow!) instead of terminating. Not >> running destructors and exception handlers will "only" leak and >> deadlock, but such an implementation would be much more difficult to >> fix. > > What do you have in mind when you distinct between "re-cancel" and > "rethrow"? If you have void f() throw() { try { cancellation_point(); } catch(...) {} } an automatic rethrow at the end of the catch clause will lead to process termination anyway because of the throw() specification. > If I have to choose between an implementation that > terminates my application every once and then or let my application > leak like a sieve I would choose neither of them ;-) but try to find > a solution without cancellation. Yes, practically speaking, you are right; but from the perspective of someone who is interested to see usable cancellation in (standard) C++ at some point in the future, one of these is still better than the other. :-) .