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



Ben Hutchings wrote:
> 
> 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?

Right. And, overhead aside for a moment, it doesn't affect the thread 
cancel state.

> 
> > 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?

http://groups.google.com/groups?selm=3EE7413D.E520E152%40web.de
http://groups.google.com/groups?selm=3EEDD118.5065FAC9%40web.de

regards,
alexander.