cancellation points report failure

David Abrahams dave at boost-consulting.com
Wed Dec 24 17:38:46 UTC 2003


Jason Merrill <jason at redhat.com> writes:

> On Sat, 20 Dec 2003 10:54:44 -0800, Mark Mitchell <mark at codesourcery.com> wrote:
>
>>> Since it apparently isn't yet clear to everybody what I had suggested,
>>> I'll outline it again:
>>
>> I think it's a great to see a tidy description of your idea.  It's good
>> to get concrete proposals on the table.
>>
>> Jason (Merill), would you care to post a similar description of your
>> preferred scenario?
>
> The scenario I've been thinking of is:
>
>  * The POSIX cancellation points can throw a cancellation exception.

I'm unhappy with this one for the same reasons as Nathan has
outlined... but there's more to your proposal.

>  * 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.

It seems to me that it should be up to the cancelling thread to decide
whether it wants to take drastic measures to ensure that cancellation
happens.  The only effective way I can think of to do that is to do
allow synchronous cancellation requests with a timeout that forces
thread termination if it fails to respond... but I'm sure there are
other approaches.
     
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the c++-pthreads mailing list