This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3] Followup to C++ forced unwinding


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Henderson wrote:
> On Wed, Apr 30, 2003 at 03:55:06PM -0700, Mark Mitchell wrote:
> [...]
>>If the catch-clause chooses not to rethrow the exception, that just
>>means this thread isn't going to be cancelled, which could happen from
>>an ordinary pthread cancellation handler.  Deferred cancellation
>>semantics don't give you any guarantees about when a thread will exit
>>after it has been cancelled.

No, this is not acceptable.  Once cancelled a thread cannot be allowed
to prevent this.  Cancellation changes the internal state of the thread,
it cannot continue running.  The POSIX standard is clear on that, if a
thread leaves the cleanup handler in some way the behavior is undefined.
 The rethrow is mandatory in case the catch blocks are expected to run.
 There is no discussion possible, this is a fact.

And your assessment that single-threaded and multi-threaded apps behave
differently is wrong, too.  There is no way a single threaded app can
get cancelled.  Normal termination, via exceptions or not, is different
from cancellation.

If catch blocks are executed they must be converted in in "finally"
blocks with automatic rethrow.  I'm not sure whether catch blocks should
be handled, my gut feeling is no.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+sFlS2ijCOnn/RHQRAiIiAKCuGj2+gFtACr4xIWdPLpOEsx/NkACfaySJ
HvCKx21WSX3mjTMz7ZSKJJg=
=ev8g
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]