[cpp-threads] Asynchronous Function Proposal

Herb Sutter hsutter at microsoft.com
Mon Jun 1 09:25:55 BST 2009


Thanks Lawrence, some initial comments:

1. I thought we already gave feedback about passing the function args separately. Why do that, when we have functors and bind (not to mention lambdas)? That is, why not provide only the single-param version,

  template<Callable F>
  void async( F f  /*...*/  );

possibly with &/&& sprinkles. Even if you can maybe get the same calling syntax using the multi-param version of the async the paper proposes.

2. Then we can put the policy parameters back at the end which seems more natural, esp. for default args.

I think 1+2 is probably a big simplification to the interface.

3. Why are there two kinds of policy? Can't this be covered by one policy?

4. Can you remind me why we need a separate future type, and if so why we don't amend the existing future types if they're somehow deficient?

5. I haven't looked at the rest carefully, but the first one caught my eye:

  template<class F>
    requires Callable<F>;
    async_future<Callable::result_type>
    async(fully_threaded policy, F f);

shouldn't the return type's "Callable::result_type" be "typename F::result_type"?

Thanks,

Herb


> -----Original Message-----
> From: cpp-threads-bounces at decadentplace.org.uk [mailto:cpp-threads-
> bounces at decadentplace.org.uk] On Behalf Of Lawrence Crowl
> Sent: Sunday, May 31, 2009 3:59 PM
> To: Bjarne Stroustrup; Boehm, Hans; C++ threads standardisation
> Subject: [cpp-threads] Asynchronous Function Proposal
> 
> Please take a look at the attacked draft proposal for the async
> function.  Comments are encouraged.
> 
> --
> Lawrence Crowl



More information about the cpp-threads mailing list