Boost logo

Boost :

From: Lee Brown (lee_at_[hidden])
Date: 2002-01-13 15:53:44


On Sunday 13 January 2002 10:33, you wrote:
> On Sun, 13 Jan 2002 11:19:41 +0100, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
> >Lee Brown wrote:
> >> I do have one question: why doesn't Boost.threads seem to support
> >> thread cancelation? It doesn't seem to be mentioned in the
> >> documentation.
> >
> >Thread cancelation is difficult to do correctly in a C++ program,
> >because you want to run all the destructors of stack objects of
> >the thread being canceled.

Yes, this is true.

Maybe Im an idealist but I think C++ should be able to do everything C
can do but usually better and with more typesafety and more stability. This
includes immediate thread cancelation. Lets face it, multithreading
capabilities are
a fundamental element of programming especially for general purpose languages
like C++. Multithreading is supposed to be a primary selling point because
C++ is frequently used for servers which dispatch many tasks simultaneously.

IMO, "we can't do that" is not an acceptable answer.

> Throwing an exception will do the clean up.

Ideally, IMO, thread cancelation is not an exception. It is expected behavior
that may be accounted for at compile time. Also, in the real world, many
people compile without exception support because of overhead issues.

FYI: ACE has cancelation. Maybe we should have a look at it.

>"Within C++, there is a much smaller and cleaner language struggling to get
>out."
>                                                    -- Bjarne Stroustrup

He puts it so well doesn't he.

lee


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