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

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



David Abrahams <dave@xxxxxxxxxxxxxxxxxxxx> wrote:
<snip> 
> 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.

What you seem to be suggesting is to convert a synchronous cancellation
into an asynchronous cancellation.  I don't see how this can be safe.
If a calling thread is to be allowed to set a time limit on cancellation
then I think the time-out action should to be to terminate the process.
However, I'm not convinced that programmers are generally very good at
setting time limits.