Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-08 06:10:04


From: "Dale Peakall" <dale.peakall_at_[hidden]>
> On Wednesday 07 August 2002 4:54 pm, you wrote:
> > I think so. Which is only evidence that the logic applied isn't
> > necessarily the logic that everyone would apply, and thus the premise
(that
> > thread<void> would indicate nothrow semantics) is shaky at best.
>
> I have to agree with Bill here. It just doesn't fit in my view of "common
> sense" which means that as I'm clearly not alone it can't be considered as
> entirely "obvious" semantics. To be honest, it looks, smells and feels
like
> a hack :-)

I am not claiming that it is "obvious". I said that it is "logical", in the
sense that when you see the explanation, you smile and think "So there _is_
some twisted logic in that!" :-)

> If you don't want your worker threads to cause your application to
terminate
> on unexpected exceptions catch(...) and add whatever logic is appropriate
to
> your application.

No, I don't want my application to terminate on _expected_ exceptions thrown
by the worker threads.

double f(double x);

double r;

try
{
    r = f(1.0) + f(2.0) + f(3.0);
}
catch(domain_error)
{
// ...
}

I want to be able to transform this to:

thread<double> tf1(bind(f, 1.0));
thread<double> tf2(bind(f, 2.0));
thread<double> tf3(bind(f, 3.0));

try
{
    r = tf1.join() + tf2.join() + tf3.join();
}
catch(domain_error)
{
// ...
}


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