|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-08-31 20:06:59
Roland Schwarz <roland.schwarz_at_[hidden]> writes:
> Matt Gruenke schrieb:
>
>>You don't see why I consider silently swallowing unhandled exceptions to
>>be effectively hiding program errors? I'll try my best to support that
>>claim, but I think we may have encountered a fundamental difference of
>>opinions.
>>
>>
>>
> Of course I do see a problem in "swallowing unhandled exceptions to
> be effectively hiding program errors". I don't think there is an issue of
> opinions.
>
> What I am trying to say is simply:
> Wheter the catch all is present or not will _not_ help to address this
> problem!
Not from a portable C++ point-of-view, no.
A platform or C++ implementation is free to implement its own
swallowing, so there's no guarantee that there will be less error
masking.
> This is a technical issue only.
>
> What woul help is calling some (possibly user supplied) handler from the
> catch clause. (Or leave it to the debugger to do something reasonably.)
> But perhaps I did not understand correctly your point and we both
> effectively are suggesting the very same?
>
> About the leaking issue:
> I have spent quite some time to help in the implementation of the tls part
> on the windows platform (to be precise: the addition of the static
> linkability
> of the thread lib.) From then I know that there might be a minor issue with
> this leak. I did not ever claim that this is a serious issue. I just
> tried to point
> out that the only usage of the catch clause at the moment is to avoid
> this.
>
> What I see as a technical problem is how you would be able to
> force a process shutdown from the context of a thread? Could you
> please try to sketch how this could be done?
You can just put the try/catch in your thread main function and call
the shutdown function from there.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk