cancellation points report failure
David Abrahams
dave at boost-consulting.com
Tue Jan 6 23:31:23 UTC 2004
Jason Merrill <jason at redhat.com> writes:
> On Wed, 24 Dec 2003 12:38:46 -0500, David Abrahams <dave at boost-consulting.com> wrote:
>
>> Jason Merrill <jason at redhat.com> writes:
>>
>>> * C++ I/O functions can throw a cancellation exception.
>>> * C++ catch blocks work normally.
>>> * If a cancellation exception is destroyed, the cancellation request
>>> is re-entered, and acted on again at the next cancellation point.
>>
>> I appreciate that your motivation is to ensure that synchronous
>> cancellation requests aren't ignored, but that doesn't really seem to
>> accomplish the goal. After all, a thread never has to reach a
>> cancellation point, and even if it does, it can keep catching and
>> discarding the exceptions indefinitely.
>
> That's fine with me. I'm not trying to assure that cancellation always
> succeeds; as you say, a thread never has to reach a cancellation point.
> My goal is to make sure that the cancellation request is never lost,
> that it remains either active or pending until the thread exits.
OK. I don't have enough of an understanding of the reasons for
cancellation in the first place to know whether it's a good goal or
not, but I don't see any major problems with it.
AFAICT, the difference between your proposal and Nathan's, once
cancellation is thrown, is that your proposal can prevent
cancellation from being thrown unexpectedly in a catch block (**)
that's part of an unwind sequence?
(**) From a destructor during unwinding also, but that could be
prevented using std::unhandled_exception().
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the c++-pthreads
mailing list