------- Comment #4 from mark at codesourcery dot com  2006-06-24 04:10 -------
Subject: Re:  C++ (throw() and catch(...) {/*  fall through
 */ } ) and pthread cancellation are incompatible (at least with NPTL)

drow at gcc dot gnu dot org wrote:
> ------- Comment #3 from drow at gcc dot gnu dot org  2006-06-24 02:52 -------
> No, that was not the consensus, and I reported this bug specifically because
> the coding practices used in libstdc++ cause problems with cancellation...
> progress was being made, the last time I read c++-pthreads, but trailed off.

I don't think it's necessary (or even useful) to wait for the standards
bodies to solve this problem.  In practice, the c++-pthreads discussion
died off, and the C++ POSIX reflector has had no activity since January.
 So, it's certainly going to be a while before we have standards
documents to rely upon.

However, we know that it should be possible to write cancel-safe C++
libraries (including, in particular, libstdc++); otherwise, it's hard to
use C++ in a multi-threaded application.  And, we know that we can do it
with a very simple hook: we just need a way to ask whether the current
thread is being cancelled.  GLIBC has lots of extensions; if we can have
__thread_cancelled(), we've got enough, without having to solve the
problem of whether or not it should be possible to catch (and not
rethrow) the thread-cancellation exception.  (I'd rather have a name for
the thread exception, as that seems more natural, but this is a
difference only of syntax; the hook function would be a perfectly
satisfactory way to make progress.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28145

Reply via email to