Hi Bill
I see that I'm way behind the times on boost::thread - I hadn't realized that cancellation had been added to it.
Interruption has been added to it, which is not what I had in mind with cancellation. The former only allows to "stop" a thread at predefined points (usually when the thread is waiting on a lock or a condition variable, etc. The latter allows to "stop" a thread anywhere (even when it is executing a while (true) {} loop). In order to be useful for the general case, both actions must lead to an exception being thrown in the target thread. An exception is required so that acquired resources can be cleaned up correctly, which is why I put the word stop in quotes above. The thread isn't really stopped immediately, it's just instructed to start cleaning up as soon as possible.
So, I'll rephrase the question - from the point of view of boost::statechart, is there a reason to prefer cancellation over some other means of stopping a thread, like calling a stop() function and then join()?
Boost.Thread doesn't offer stop(). Which threading API do you have in mind? Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.