This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/28145] C++ (throw() and catch(...) {/* fall through */ } ) and pthread cancellation are incompatible (at least with NPTL)
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2006 04:10:23 -0000
- Subject: [Bug other/28145] C++ (throw() and catch(...) {/* fall through */ } ) and pthread cancellation are incompatible (at least with NPTL)
- References: <bug-28145-3264@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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