Boost logo

Boost :

Subject: Re: [boost] [thread] boost::future::then
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-10-10 10:56:30


Le 09/10/15 21:49, Vicente J. Botet Escriba a écrit :
> Le 09/10/15 15:44, Vladimir Prus a écrit :
>>
>> thanks for the response. I suppose it would work - although if I need
>> to pass this
>> executor any time I call 'then', it become rather awkward rather
>> quickly.
> Well this is the current interface :)
>> It would
>> be nicer if promise could have an executor, and pass it to future and
>> then
>> to futures returned by 'then', so that I only need to to specify
>> custom behaviour
>> when creating a promise - that can be easily wrapped in a function.
> If your future is created with
> auto f = async(ex, fct)
>
> then the call to
>
> f.then(fct2);
>
> would use the same executor ex.
>
> "When the scheduler or launch policy is not provided the continuation
> inherits the parent's launch policy or scheduler. "
>
Hrr, I've just checked that I've not implemented this :(. This needs
some kind of type-erasure of the Executor as we need to store it in
order to use the same executor.

Ticket created https://svn.boost.org/trac/boost/ticket/11716

Vicente


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