[c++-pthreads] Restating the Jason model
Mark Mitchell
mark at codesourcery.com
Mon Jan 12 20:51:21 UTC 2004
On Mon, 2004-01-12 at 12:39, Jason Merrill wrote:
> I think this is an appropriate time to restate my proposal. I think
> there's a fair amount of consensus around these three points:
>
> * Cancellation is a normal exception.
> * If a cancellation exception is destroyed, the cancellation request
> is re-entered, and acted on again at the next cancellation point.
> * Cancellation is disabled during unwinding.
Thank you for summing up.
I believe that I would support all elements of your proposal, with the
possible exception of:
> My preference is still to amend the C++ standard to allow stdio functions
> to throw cancellation.
However, I don't see that as a particularly big deal one way or the
other. The observation has already been made that the goal of
preserving existing C++ code is probably incompatible with introducing
cancellation, although Nathan's ETHREADCANCELLED idea is designed to get
around that.
> * Should cancellation also be disabled in destructors run during normal
> execution? In catch blocks?
>
> IMO, no and no.
Agreed.
> * How can C++ code interact with a cancellation exception?
>
> I think everyone agrees that it should be possible to catch a cancel by
> name. We still need to specify that name and any additional operations the
> cancel object might support.
Agreed.
> * What about pthread_exit?
>
> I'm happy with the g++ status quo whereby destroying a pthread_exit
> exception calls terminate. Unlike cancellation, the position of a call to
> pthread_exit is deterministic, so the user is responsible for making sure
> that it can propagate.
I have no strong feeling here, but calling "abort" would be fine by me.
--
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC
More information about the c++-pthreads
mailing list