Subj : Re: pthread function behavior in C++ program To : comp.programming.threads From : Torsten Robitzki Date : Thu Jun 09 2005 11:57 am wij@seed.net.tw wrote: > Hi: > Sometime ago I found my C++ programs were outdated by so called > NPTL(probably). Programs built (on Fedora 3) indicate that > thread cancellation can cause an object thrown at cancellation > point. So, what should I expect pthread function will behave in > C++ and modify my programs? or does any documents there specify > pthread function behavior(in C++ codes)? The problem is, that there is no binding of pthread to c++ (yet). I don't know your implementation, but I guess that most c++ compiler vendors define somewhere how cancellation will be handled. For my platform (Alpha/VMS) it is guarantied that destructor will be executed, but c++ exception handlers will not in case that a thread get canceled. So one can not rely on C++ exception handlers but on destructors and I guess that in a further C++ standard on can rely on destructors too. So the best thing one can do is to avoid cancellation at all or as a second best solution don't rely on exception handlers being called. > Strange to say, I have > searched for days and found nothing available/useful to update my > programs for NPTL! Can anybody give some hints. Take for instance > pthread_cancel/pthread_testcancel/pthread_cond_wait.. > thank you in advance. > I used "NPTL C++ cancellation" to search on google and the results looks very promising. regards Torsten .