[cpp-threads] Re: Exception propogation across threads

Paul E. McKenney paulmck at linux.vnet.ibm.com
Thu Feb 22 16:58:56 GMT 2007


On Thu, Feb 22, 2007 at 10:37:17AM +0000, Anthony Williams wrote:
> "Paul E. McKenney" <paulmck at linux.vnet.ibm.com> writes:
> 
> > On Wed, Feb 21, 2007 at 10:09:21PM +0000, Kevlin Henney wrote:
> >> I am concerned that making total process death the chosen behaviour 
> >> shows a default bias towards coarse-grained threading, just as we are 
> >> moving into the era of fine-grained threading. As I said before, killing 
> >> the whole process seems unnecessarily severe: feel free to consider it 
> >> an option, but we should avoid imposing what some (myself included) 
> >> might consider to be unreasonable defaults.
> >
> > So you want some way of being able to propagate exceptions into the parent
> > thread.  I don't have a problem with that, as long as it is not the default
> > behavior.  I suppose the "right" thing to do would be to have another
> > pthread_attr_t attribute...
> 
> How about we provide two standard handlers: one that aborts the application on
> unhandled exceptions in a thread, and one that propagates the exception to the
> calling thread. I'm not too fussed which is the default, but do have a slight
> inclination towards "propagate".
> 
> It could well be that the "propagate" handler is a no-op, and that the
> thread-launching facility actually handles the propagation, but that's a small
> detail. By putting the choice in the library we avoid the user having to write
> any propagation code manually, which is a good thing since that is non trivial.

I still believe that the default should be kill rather than long-delayed
propagation, because it is important to locate problems quickly.  We want
to find problems during testing, not after deployment.

That said, I do like the idea of providing an easy way to select the
"propagate" behavior.

							Thanx, Paul



More information about the cpp-threads mailing list