Boost logo

Boost Users :

From: Boris Kolpackov (boris_at_[hidden])
Date: 2006-12-11 02:03:46


Hi Roland,

Roland Schwarz <roland.schwarz_at_[hidden]> writes:

> If you carefully rethink the need for cancellation you most likely will
> find that you really will need cancellation rarely. You almost always
> can use some other interthread communication mechanisms.

It also almost always requires sneaking an ugly "special case" into
an otherwise clean and simple code (e.g., a special cancellation pipe
for a thread waiting on select, a special flag for a thread waiting on
condvar, etc.). It is in essence very similar to the exceptions vs
error codes debate; as with exceptions, with proper thread cancellation
you can separate the main logic from the thread termination code.

> Full blown cancellation often is a too coarse grained tool anyways.

I find this statement unsubstantiated. Can you elaborate a bit on this?

thanks,
-boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net