Wolfgang Bangerth wrote:
[...]
> > async_result<double> res;
> > thread t(bind(res.call(), a, b, c));
> > // do something else
> > d = res.value();  // Explicitly waits for the thread to return a value?
> 
> This does the same, indeed. Starting a thread this way is just a little
> more complex (and -- in my view -- less obvious to read) than writing
>   thread t = spawn(foo)(a,b,c);

  joinable_thread_ptr< double > tp = new_thread(foo, a, b, c);
  d = *tp->join(); // double pointer is used to report cancelation 
                   // and timedjoin() timeout; in this case, the
                   // thread shall never be canceled.

> 
> But that's just personal opinion, and I'm arguably biased :-)

Right. ;-)

regards,
alexander.

> PS: Can you do me a favor and CC: me? I just get the digests of the 
> mailing list and replying is -- well, tedious ;-)

news://news.gmane.org/gmane.comp.lib.boost.devel

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to