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

Gabriel Dos Reis gdr at integrable-solutions.net
Fri Jul 15 14:02:21 UTC 2005


David Abrahams <dave at boost-consulting.com> writes:

| Dave Butenhof <david.butenhof at hp.com> writes:
| 
| > You can try to say that C frames using POSIX cleanup cannot be 
| > interleaved with C++ frames; and that C++ frames using C++ cancel cannot 
| > be interleaved with frames using POSIX cleanup. But that makes no 
| > conceivable sense, and in practice is an unreasonable and infeasible 
| > restriction. They have to interoperate. They have to be the same.
| 
| I'm sure I'm missing something important here, but I'm going to barrel
| ahead with my misconceptions anyway so that someone will set me
| straight.

there are codes that register callbacks as 'extern "C"' functions to
libraries that are written in C (following the urban legend "what is
good for C is good enough for C++").  Such callbacks may happen to
throw exceptions, either directly from user codes or as the result of 
standard library functions throwing.
The pratice is widespread enough for compilers to support that.
That is the model by deftault with the Sun compiler (at least the ones
I test with).  GCC/gcc uses -fexceptions to support that too.

-- Gaby



More information about the c++-pthreads mailing list