Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-08-06 08:56:46


--- In boost_at_y..., "Hillel Y. Sims" <hys420_at_y...> wrote:
> OpenVMS 7.3 (and earlier) uses (VMS) exceptions to implement
pthread exit
> and cancellation. These system exceptions are catchable by "catch
(...)".
> For this reason (and the fact that other types of events
intercepted by
> catch (...) include system exceptions such as accvios, various
arithmetic
> traps, etc.), we mandate that all code in our multi-threaded
environment
> that does catch (...) must refrain from doing much more processing
than
> freing resources and must always "throw;" to reraise the exception,
so
> that it can be properly handled by the threads system (or a stack
trace
> printed if an accvio occurred, etc). I don't imagine it's really
ever
> valid for any code, except maybe absolute outermost-level error
handling
> routines, to catch (...) w/o reraising the exception untouched --
> certainly not library code of any nature. I would be disappointed
to see
> one of our developers writing a catch (...) block w/o rethrowing,
and I
> would be disappointed to find that any third-party code I wanted to
use
> was using catch (...) blocks that did any kind of non-trivial
processing
> and/or did not rethrow the exception.

It's not uncommon to hijack an exception in a catch(...) within a
destructor in order to insure the program isn't automatically
terminated. The worst consequence is the fact that use of exceptions
for cancellation will mean that no object can safely call a function
with a cancellation point within it's destructor.

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk