Boost logo

Boost :

From: Darryl Green (Darryl.Green_at_[hidden])
Date: 2004-02-10 02:11:36


> -----Original Message-----
> From: Stefan Seefeld [mailto:seefeld_at_[hidden]]
>
> Darryl Green wrote:
> > 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.

I was assuming that all the discussion about how to define the set of
exceptions to be caught was about trying to (rather painfully) avoid
slicing. The virtual constructor sounds like magic to me, but maybe it
is just sufficiently advanced technology. Do you have a trick up your
sleeve to actually do this? And how does it relate to whether it can be
done without changing the existing boost.thread interface?

Thinking about it, I suspect Peter Dimov was thinking of avoiding the
virtual constructor by keeping the referenced object alive after the
"join". I guess you could do this by blocking in the catch block (ie
don't really terminate at all) until the async call object is destroyed.

I'm probably still missing something...

Regards
Darryl.

##########################################################################
This e-mail is for the use of the intended recipient(s) only. If you have
received this e-mail in error, please notify the sender immediately and
then delete it. If you are not the intended recipient, you must not use,
disclose or distribute this e-mail without the author's prior permission.
We have taken precautions to minimise the risk of transmitting software
viruses, but we advise you to carry out your own virus checks on any
attachment to this message. We cannot accept liability for any loss or
damage caused by software viruses.

##########################################################################


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