Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2004-02-09 00:32:21

Of course you cannot portably pass all exceptions, but you may be able to
pass all the ones that use standard types.

This problem needs to be addressed in the context of delayed calls (or
whatever the current phrase if for it) where you curry the arguments now,
save the call for later dispatch and do it later (and maybe even return a

We managed to solve this problem for each of the exceptions mentioned in
Josuttis 1st edition plus all of the implicit types and one of our
library's exceptions (derived from std::runtime_error which supported an
error_number in addition to what()). We solved this for a message passing
system. The exceptions came back when you waited for a reply to a
message. The code wasn't great, but it did the job, and since exceptions
were rare (exceptional one might say) the hit on performance was
unnoticeable, but it certainly made writing the programs somewhat simpler.

I believe the same approach could be taken with threads & join().
Will it solve everything? No.
Will it solve may of the things people want to do? I believe so.
How much will it affect the runtime? That depends on the exception
handling capabilities of the system. In particular we had, iirc, about 20
catch() clauses after the try around the call to the
"dispatchThisMessage()" call.

At Sunday 2004-02-08 09:23, you wrote:
>Christopher Currie <christopher_at_[hidden]> writes:
> > Slawomir Lisznianski wrote:
> >> Are there any plans to support handling of exceptions thrown during
> >> joinable thread execution? I recall Usenet discussions with proposals
> >> varying from Futures to throwable join():
> >> try {
> >> thread.join();
> >> }
> >> catch (std::runtime_error& e) {
> >> ...
> >> }
> >> Any ideas?
> >
> > Doesn't this require a certain amount of compiler support?
> > IIRC, some compilers don't support throwing exceptions across thread
> > boundaries...
>Right. This can't be done portably.
>Dave Abrahams
>Boost Consulting
>Unsubscribe & other changes:

Victor A. Wagner Jr.
The five most dangerous words in the English language:
               "There oughta be a law"

Boost list run by bdawes at, gregod at, cpdaniel at, john at