What are the real issues?

David Abrahams dave at boost-consulting.com
Thu Jan 8 15:03:40 UTC 2004


Ted Baker <baker at cs.fsu.edu> writes:

>>   (3) how to preserve the frankly enormous body of thread-safe code
>>       already written, deployed, and running for years.
>
> Just be be clear.  You mean by "thread-safe" that the code
> uses mutexes to protect access to shared data, but that it does
> not use cancellation state management and cleanup handlers
> to protect against thread cancellation.... right?
>
> If so, the only way out seems to be to require that for C++
> programs the initial cancellation state of every thread is
> *disabled*.
>
> If you do that, then no thread can be cancelled unless it
> contains a call to explicitly enable cancellation.

That unfortunately misses a great opportunity to allow thread-safe and
exception-neutral code to respond to cancellation requests without
modification.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the c++-pthreads mailing list