Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-06-29 11:10:22


--- In boost_at_y..., John Max Skaller <skaller_at_o...> wrote:
> Greg Colvin wrote:
>
> > To be clear, just stopping a thread "out of nowhere" is
> > a bad idea, as there is then no way to get out of any
> > monitors it has entered. Better is a way to throw an
> > exception on the thread, so as to let destructors run.
>
> You did not meet the requirements.
> The thread is blocked. It cannot throw anything.
>

This is not true. Any operation that is a "cancellation point" can
block until either the operation completes, in which case it returns
normally, or until a cancellation occurs, in which case it throws.
This is, in fact, the method taken by the J/Threads C++ library.
This approach has other problems, though, and I've pointed them out.

> It is a core language issue whether destructors
> are run when a thread is cancelled.

Only if threads are a core language feature. We're not discussing a
change to the core language, we're discussing a Boost threading
library.

Bill Kempf


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