Boost logo

Boost :

From: Mac Murrett (mmurrett_at_[hidden])
Date: 2002-01-14 11:06:14

On 1/14/02 10:41 AM, "David Abrahams" <david.abrahams_at_[hidden]> wrote:

>> Generally, the library defines certain functions as "cancellation
>> points". A CheckForCancellation() is often a "free" cancellation
>> point, but methods known to block a thread for an indeterminate
>> amount of time (such as mutex locking) are generally made
>> cancellation points as well. This allows the blocking function to
>> return the instant (or close to) that a cancellation request is made,
>> instead of having to finish the blocking operation. This can
>> actually be important to avoid some deadlock situations.
> Sure, that works. The upshot, however, is that you have to rely on the
> programmer to call the "right" functions, or the thread will never respond
> to cancellation.

Most modern OSes (NT, Mac OS X, etc.) have a special place in hell for
threads that never block, as this is generally considered error.

As an aside, I am in favor of Bill's approach, if we implement cancellation
at all. I would suggest making the exception a private member type of
thread, so that it can only be caught by thread::thread_proxy.


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