[cpp-threads] Asynchronous Function Proposal

Boehm, Hans hans.boehm at hp.com
Mon Jun 8 22:22:42 BST 2009


> From: Bjarne Stroustrup
> 
> Herb Sutter wrote:
> > Hans wrote:
> >   
> >
> >>
> >> A more minimalist approach may be to support only the 
> fully_threaded 
> >> policy for now, but leave room for additional policies in 
> the future.
> >>     
> >
> > I disagree. We should provide "run on another thread" (not 
> necessarily a new thread!), "run on this thread," and 
> "implementation decides."
> >
> > Herb
> >
> 
> agreed (my minimalist approach would be to provide only 
> "implementation decides", but since that has no hope of 
> passing, I don't propose something that minimal)
> 
I'm fine with any of the policy choices mentioned above.

And I don't currently see a reason exceptions shouldn't always be reported at the request point.

Thinking about this more, I'm not sure I fully understand the implications of allowing or disallowing execution at the call point.  It means the implementation has no way of throttling the number of pending tasks in various queues, where current implementations (notably TBB) apparently tend to do so.  Given the current API proposal, I guess we need space to store all the futures anyway, at least in the absence of nontrivial compiler optimizations.  Thus I'm not sure how major the impact would be.

Hans


More information about the cpp-threads mailing list