|
Boost Users : |
From: peter_foelsche_at_[hidden]
Date: 2008-07-16 19:38:28
Exceptions should be caught somewhere.
The software engineer has to make certain of that by adding a try-catch-block on every interface boundary -- such boundaries are usually points where C++ borders on C or the operating system -- e.g.
* the main-function,
* window message handlers,
* thread-functions,
* callback handlers provided by certain frameworks
e.g. to read from a file descriptor.
I don't think a thread package should provide features for storing exceptions, since this would require a new base class other than std::exception.
You may want to make certain that the exceptions thrown inside a thread function are not simply ignored -- e.g. the string returned from what() can be stored and displayed by the main thread.
-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Ruediger Berlich
Sent: Wednesday, July 16, 2008 10:41
To: boost-users_at_[hidden]
Subject: [Boost-users] [Boost.thread] Exception handling strategy ?
Hi there,
is there a recommended strategy for exception (or more generally
error-)handling with Boost.thread ? From what I can see it is not safe to
throw an exception from within a thread, as it is not sure who catches it
(or whether it gets caught at all).
Best, Ruediger
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net