Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2004-02-09 23:54:34


Darryl Green wrote:

> Can't some function object wrapper catch and store the exception
> somewhere other than in the "thread state" for later access
> from some sort of async call object regardless of the underlying
> thread implementation?
>
> The joining thread would wait on one of these async call
> objects (ie join). The async call object and the wrapper
> would have shared access/ownership of the result (exception
> or return value) storage.
>
> What am I missing?

to 'catch and store' an exception, i.e. to take it out of its
(C++) call stack, you need a 'virtual constructor' of some sort,
so the exact type is remembered in the clone (which is not just
a slice of a common base class) and can be re-dispatched in
a different context, i.e. the joining thread.

Regards,
                Stefan


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