Re: [c++-pthreads] Re: thread-safety definition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: thread-safety definition



David Abrahams wrote:

Dave Butenhof <David.Butenhof@xxxxxx> writes:

I think I disagree, at least philsophically, with the characterization
of the model as "fragile". But I think I also understand what you
mean; and the problem isn't with the model, but rather with the effect
of that model on existing code that all-too-casually and agressively
eats exceptions it doesn't understand. I think there are vanishingly
few circumstances where a blind catch(...) without an unconditional
re-throw should be considered "legitimate". If you don't completely
understand what an exception means, you cannot claim to have
completely recovered, and therefore cannot reasonably finalize
propagation.
The problems with catch(...) eating all exceptions are maybe not as
bad as you think.  As a matter of fact, there are vanishingly few
exceptions that demand special recovery actions that wouldn't work for
all other exceptions.  Systems designed that way tend towards
fragility.
I see an immense difference between a pragmatic statement that "in practice there seem to be few exceptions" and something on which cross-platform, mixed-language, modular environment programmers can depend as a law. C++ does not say that "all exceptions can be finalized and recovered fully by performing these steps". To presume they can is fragile.

--
/--------------------[ David.Butenhof@xxxxxx ]--------------------\
| Hewlett-Packard Company       Tru64 UNIX & VMS Thread Architect |
|     My book: http://www.awl.com/cseng/titles/0-201-63392-2/     |
\----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/