Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2004-02-10 01:03:21

At Monday 2004-02-09 16:08, you wrote:

> > "Is everyone convinced that propagating the exception into the joining
> thread
>is the right behavior or even semantically sensible?"
>as a novice user of concurrent programming ( especially when compared to the
>level here in the boost list ), may i ask whether it is going to be
>possible to
>identify the throwing thread or not?
>here's why i am asking this: let's say i have two threads reading two
>files and one of them throws ios_base::failure. this information by itself is
>meaningless if i catch it in the master thread as i don't have a way of
>identifying the source. currently, we employ a different mechanism ( using
>pthreads for now; wishing to switch to boost.threads ): each thread has
>its own
>error code in a shared container and if they want to report an error, they
>to that container. that way, we know which thread is reporting what error and
>we can handle it. elegant? not at all but it works
>so i wonder if propagating exceptions from worker threads to the master thread
>is gonna have some comparable functionality? ( worker/master architecture
>is the
>only model we commonly use so i can't really talk for other thread
>). if it doesn't, i think the best a programmer like myself can do is to
>( ... ) and then still use the shared error code container to resolve the
>am i misunderstanding this mechanism or is it gonna be like i described above?

I haven't looked at boost::thread closely at all, but I'd guessed that
"start_thread()" would have returned some sort of handle, and
"join(somehandle)" is how you do it. I believe this is sufficient for your

Now, I may be _completely_ wrong on how boost::threads works, I didn't
write it.

> > Stefan Seefeld <seefeld <at>> writes:
> >
> > > Glen Knowles wrote:
> > >> From: David Abrahams [mailto:dave <at>]
> > >> >> Of course you cannot portably pass all exceptions, but you may
> be able
> > >> >> to pass all the ones that use standard types.
> > >> >
> > >> >And what if the std library or somebody else throws exceptions
> > >> >*derived* from the standard types?
> > >> If it is not a recognized corba exception what the ACE TAO does is
> > >> eat it with a catch(...) and then throws a corba system exception on
> > >> the other side.
> > >
> > >
> > > yes, so all exceptions that are allowed to pass have to be explicitely
> > > declared
> > > as such. If it is not declared, a special standard exception will be
> > > thrown (or may be something equivalent to 'unexpected'). If it is
> > > derived from a declared one, it will be sliced.
> >
> > Is everyone convinced that propagating the exception into the joining
> > thread is the right behavior or even semantically sensible?
>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