[cpp-threads] Asynchronous Function Proposal

Herb Sutter hsutter at microsoft.com
Wed Jun 3 15:50:58 BST 2009


> > >  - We shouldn't propose a third future type. This one should
> > >    return unique_future (and that and shared_future should be
> > >    fixed if deemed necessary). Note that this fixes a usability
> > >    issue with the current proposal, namely that the user can't
> > >    put the result in a shared_future if copying is required.
> >
> > Can you provide a use case for why this flexibility is helpful?

Anytime the result is of interest to more than one thread. You don't want to block-then-share, you want to pass everyone a future so everyone can keep running concurrently until they need the result. In dataflow terms, think of any example where we split the pipe two or more ways.

> > After all, the original call was single-point as well.

But there's necessarily always one caller. :-)

Herb




More information about the cpp-threads mailing list