Re: [c++-pthreads] Re: thread-safety definition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: thread-safety definition



On Jan 16, 2004, at 7:26 PM, David Abrahams wrote:

AFAICT the discussion is about whether it makes sense to support
programs which do catch(...) without rethrowing, and if so, how.
Right now we're discussing a morality issue: "is it inherently evil to
catch(...)  without rethrowing?"

And my position on the morality question would be that yes, it
is inherently evil, but that sometimes programs have to do evil
things.  I can think of a couple of designs that rely on being
able to catch exceptions and not rethrow them, and I'm sure you
can too.  (Mostly designs where the catch(...) is part of an
adapter layer that translates between one kind of error reporting
mechanism and another one.  The (...) will get translated into
something like "unknown error".)

And I agree with what you said in an earlier message: the big
question is, in designs like that, whether thread cancellation
needs to be translated too and whether it needs to be translated
in the same way.

I'm leaning toward the idea that thread cancellation should be
an ordinary C++ exception, that we should name it, that it should
be catchable in the ordinary ways, and that people who need to be
able to catch everything but a cancellation exception have some
perfectly good mechanisms for doing that.

Of course, this still doesn't resolve everything.  The question
still remains: what are the cancellation points, and are there
any circumstances (e.g. during the unwinding process itself)
under which cancellation is temporarily disabled?

			--Matt