
Excerpts from Simon Marlow's message of Mon Sep 13 05:10:13 -0400 2010:
The idea of having user-definable cancellation mechanisms seems quite sensible, given that we have so many ways to do this. However it seems quite hard in practice: for pthread_cancel, the RTS has to behave quite differently from pthread_kill. The API for defining the cancellation mechanism could get quite complicated.
For now I would go with 'interruptible' (meaning either pthread_kill() or CancelSynchronousIO()). It's not nearly as dangerous as pthread_cancel(), but it covers a lot of the cases we're interested in, and it doesn't have problems with bound threads.
Sounds good. I'll roll this change tomorrow. Maybe we should emit a warning pre-Vista that "interruptible" is not being honored? Also, it occurs to me that a lot of this functionality could be implemented in user space. Cheers, Edward