exception handling in multithreaded applications (was: RE: Boost and exceptions)

Fabio Fracassi wrote:
Yes it is, because in reality boost exception solves problems for the users of any library that uses it. When using boost exception I can safely let exceptions escape threads and have them rethrown in the starting thread, for instance.
I would be interested to learn how you do this. With open-mp (and mpi), my current way to add exception handling code really adds much noise: bool cancel = false; #pragma omp parallel shared(cancel) { try { ... the real code } catch (std::exception& r) { cancel = true; store_exception(r); } } if (cancel) { rethrow_exception(); } Regards, Thomas

On Fri, Jun 22, 2012 at 11:17 AM, Thomas Klimpel < Thomas.Klimpel@synopsys.com> wrote:
Fabio Fracassi wrote:
Yes it is, because in reality boost exception solves problems for the users of any library that uses it. When using boost exception I can safely let exceptions escape threads and have them rethrown in the starting thread, for instance.
I would be interested to learn how you do this. With open-mp (and mpi), my current way to add exception handling code really adds much noise:
See www.boost.org/doc/libs/release/libs/exception/doc/tutorial_exception_ptr.html . Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
participants (2)
-
Emil Dotchevski
-
Thomas Klimpel