Boost logo

Boost :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2007-03-26 15:51:52


Howard Hinnant wrote:
> 1. Owner to t: I'm no longer interested in your computation (but
> somebody else might be).
> 2. Owner to t: I want you to clean-up and stop as soon as possible.

Aren't we trying to ask for too much?

If we were able to

thread t();
...
t.raise(exception);

throw an exception at a thread, the thread itself can take whatever
action is sensible at this point. It could just change its current
path of control, it could stop (after having reestablished all
invariants), it can propagate the exception to its "parent".

Just let the user decide what is the best strategy for the
particular thread.

This scheme, while not mentioning cancellation at all is able to
deliver almost everything cancellation also could. The difference
"throwing an exception at a thread" is not an all or nothing decision.

Roland


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk