Subj : Re: pthread function behavior in C++ program To : comp.programming.threads From : Peter Dimov Date : Sun Jun 12 2005 04:43 am Torsten Robitzki wrote: > Peter Dimov wrote: >> Alexander Terekhov wrote: > >>> Well, it can be caught using catch(...), but not finalized. Under >>> NPTL, catch(...) of "forced unwind" is supposed to exit with >>> rethrow, otherwise they terminate the entire process. It's not C++ >>> anymore. >> >> Well... that's much better than not running destructors or entering >> catch(...) blocks at all. When C++ people complain loudly and >> persistently, the NPTL folks will just stop terminating and all will >> be well. It's only a matter of time. Even the most stubborn people >> admit their mistakes given a year or two of the world sadly shaking >> its collective head. > > There are cases, where one realy don't care if an error occures or not > and this can be expressed with an exception handler who catches all > exceptions without rethrowing them. Such former legal code would now > cause every now and then the program to terminate if a thread get > canceled? Than not runnung destructors and exception handlers at all > seems to be more predictable to me. 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. .