Possible language changes

Boehm, Hans hans.boehm at hp.com
Mon Mar 7 22:33:54 GMT 2005


> 
> We found that a LOT of people want cancellability. The API is
> a bit of a compromise -- "cancel" is allowed to return false for
> any reason, meaning that you couldn't cancel, so caller must
> somehow cope. And its mayInterruptIfRunning arg is just a hint,
> not a mandate to asynchronously cancel. People seem to be able
> to live with this.
> 
Just to reiterate a relatively minor point, and make sure I'm not
confused:

It seems to me that the Java notion of cancellation on a future
is actually rather conservative compared to pthreads.  Setting
mayInterruptIfRunning corresponds to a pthread cancellation
type of PTHREAD_CANCEL_DEFERRED.  There is no equivalent of
PTHREAD_CANCEL_ASYNCHRONOUS (which is almost always unsafe).

Hans






More information about the cpp-threads mailing list