Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-06-27 12:38:23

--- In boost_at_y..., John Max Skaller <skaller_at_o...> wrote:
> Greg Colvin wrote:
> > Because killing threads is a bad idea.
> No, it isn't a 'bad idea'. It is essential
> in many applications, in particular, it is essential
> in most multithreaded servers to kill client connection
> management threads when they're unable to detect that
> the connection is lost or exceeded some bound
> (such as 'out of money').

Rarely is killing required. Almost always the thread itself can
simply exit instead of having an outside mechanism for terminating
it. This is true even in the case you give here. When the ability
to terminate a thread from the outside is needed it is usually safer
and easier to use synchronization primitives such as condition
variables instead of outright killing the thread. This is precisely
why Java deprecated this functionality.

I won't claim that we may not need cancellation for those rare cases,
but cancellation is dangerous enough (and problematic enough to
implement) that I'm not going to include it in Boost.Threads until
and if the issue can be fully analyzed and a portable implementation
can be done. Considering all of this, I think 'bad idea' is a proper

Bill Kempf

Boost list run by bdawes at, gregod at, cpdaniel at, john at