RE: [c++-pthreads] Restating the Jason model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [c++-pthreads] Restating the Jason model



Alexander Terekhov <boo@xxxxxxxxxxx> wrote:
> Dave Butenhof wrote:
> [...]
> > I'm not entirely sure I understand what you mean here by
> > '"intelligent" cancel request delivery". If we discussed it before
> > I don't recall that phrase.
> 
> I mean "bool std::expected_exception<T>() throw()" thing.
> "Intelligent" cancel request delivery means that cancellation points
> and async-cancel regions shall throw (deliver)
> std::thread_cancel_request only when cancellation is enabled (cancel
> state is equal to PTHREAD_CANCEL_ENABLE) AND
> "std::expected_exception<std::thread_cancel_request>()" is true at 
> throw point (i.e. there's reachable catch handler for it in the
> dynamic context).

So this is a way to avoid the overhead of disabling and enabling
cancellation in destructors (and elsewhere) - and it requires 2-phase
exception-handling, right?

> Throw specs (dtors would have implicit throw() imposed on them)
> would act like "fences"; they should NOT have catch(...) effect.

Am I right in thinking that aside from this wart 2-phase EH is
allowed but not required by the current C++ standard?