[c++-pthreads] Re: pthread_cancel and EH: let's try this again

Peter Dimov pdimov at mmltd.net
Sat Jul 23 14:38:29 UTC 2005


Alexander Terekhov wrote:

> Race or no race, there's nothing particularly unusual to have
> things like pthread_cond_wait() in the dynamic or static context
> of conventional catch. Your change may result in threads blocked
> forever.

Yes, I know.

I don't insist on this particular model. I'm in favor of a family of models 
whose characteristic is no implicit cancel state manipulation and 
conditional cancel delivery.

The actual condition can be "no unfinished exception", but it can also be 
"no uncaught exception", "no unfinished cancellation exception", and so on. 
Whichever works best and is acceptable to implementors.

Simple heuristics such as "no unfinished exception" are obviously 
technically inferior to intelligent 2-phase query-based conditions with 
implicit throw() injections on destructors during unwinding, but they are 
much simpler to implement. 




More information about the c++-pthreads mailing list