Boost logo

Boost :

Subject: [boost] exception handling in multithreaded applications (was: RE: Boost and exceptions)
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2012-06-22 14:17:11


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


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