Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-08-09 14:26:51


At Thursday 2002/08/08 04:10, you wrote:
>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));

I trust that:

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

would be acceptable also?
That would allow the 2nd argument in thread<> to default to
"terminate_on_exceptions" for those who think it's necessary.

>try
>{
> r = tf1.join() + tf2.join() + tf3.join();
>}
>catch(domain_error)
>{
>// ...
>}
>
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"


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