Re: cancellation points report failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cancellation points report failure



Jason Merrill <jason@xxxxxxxxxx> writes:

> On Wed, 24 Dec 2003 12:38:46 -0500, David Abrahams <dave@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>> Jason Merrill <jason@xxxxxxxxxx> 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