Re: [c++-pthreads] Re: cancellation points report failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: cancellation points report failure



Dave Butenhof wrote:
[...]
> >Note that the use of POSIX asynchronous cancellation (I mean the
> >presence of async-cancel{-safe} regions on the execution path) does
> >NOT guarantee thread termination (cancel request delivery) at all.
> >Conforming implementations are free to ignore it completely, so to
> >speak. I wish the standard would define pthread_testcancel() "in
> >terms" of an empty async-cancel region (and it would also provide
> >async-cancel-safety for pthread_testcancel() itself):
> >
> >void pthread_testcancel() { /* mandatory shall occur semantics */
> >  int oldtype;
> >  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
> >  pthread_setcanceltype(oldtype, &oldtype);
> >}
> >
> >
> This is all way off topic, but what's your point here, Alexander?
> 
> Are you intending to suggest that pthread_setcanceltype() be made a
> guaranteed cancellation point, ...

I'm (once again) intending to suggest that "an act" of transition 
from synchronous to asynchronous cancellation be made a guaranteed 
cancellation point so that "passing through" any async-cancel-safe 
region with cancel request pending on its entry (or by the time of 
pthread_testcancel() invocation inside async-cancel-safe region [I 
also want pthread_testcancel() be added to the list of async.cancel
safe functions]) shall result in raising std::thread_cancel_request 
exception (subject to PTHREAD_CANCEL_ENABLE cancellation state, of 
course). Well, to you, this is/was just a matter of control (apart 
from your async-cancel "phobia"***, so to say):

google.com/groups?threadm=ki1M8.3%24VD1.187532%40news.cpqcorp.net
(Subject: Re: cancelling one thread from inside another one)

I disagree.

regards,
alexander.

***) "Personally, if I were to spend any serious time considering 
the future of async cancelability in the standard, I'd rather 
argue for removing it entirely." (quote taken from the other 
message of yours in the same thread referenced above)