[c++-pthreads] Re: thread-safety definition
Alexander Terekhov
boo at terekhov.de
Mon Jan 12 12:05:47 UTC 2004
Ted Baker wrote:
>
> > The problem is that cleanup -- e.g. execution of C++ destructors on
> > stack unwinding -- may involve calls to I/O routines that are themselves
> > cancellation points. If these routines fail, then the cleanup functions
> > will not achieve their intended purpose; they will not be able to release
> > the resources that the thread holds. Nathan's model implies that they
> > will fail.
>
> This cannot happen if cancellation is automagically disabled during
> execution of (all) destructors, along with the stack unwinding code
> that is performed during exception processing.
Except that it would pretty much preclude SAFE exploitation of
cancellation in the destructors (stuff ala "~temp_dataset()" which
can simply catch cancel request exception and "re-enable/re-inject").
Burning processing cycles on cancel enable/disable is another issue
here, BTW. Intelligent cancellation that would check the dynamic
context (2-pase ES with exception specs acting like "fences" NOT
causing unnecessary unwinding) would work much better, I guess.
regards,
alexander.
More information about the c++-pthreads
mailing list