|
Boost : |
Subject: Re: [boost] Executor associated to the future continuations (was [thread] boost::future::then)
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-10-29 05:08:41
On 11-Oct-15 9:30 PM, Vicente J. Botet Escriba wrote:
> Le 10/10/15 16:58, Vicente J. Botet Escriba a écrit :
>> Le 10/10/15 15:26, Vicente J. Botet Escriba a écrit :
>>> Le 10/10/15 07:57, Vladimir Prus a écrit :
>>>>
>>>> So, the function must be executed in different thread from all the continuations,
>>>> and it would seem I'd need to something set executor on promise for that to work?
>>>>
>>>
>>> I will see how adding an Executor parameter to promise, packaged_task constructors and
>>> make_ready_future/make_exceptional_future could be implemented if this will solve your use case.
>>>
>> I've create https://svn.boost.org/trac/boost/ticket/11717 to track this feature request
>>
>>
> This commit contains a fix for this issue as well as the addition of the VERY-EXPERIMENTAL promise::set_executor and
> packaged_task::set_executor. These should be replaced by constructors having an executor as parameter.
>
> https://github.com/boostorg/thread/commit/b8db8fef8b28414d16c66761badc1c6fcadfc38f
Vicente,
I've created a very early experiment, here:
https://gist.github.com/vprus/3a7bea25e4c0a0e4222d
Does it look generally right for you? I'm worried that Executor interface requires methods like
close/closed, try_executing_once and reschedule_until that don't seem documented in detail. Is
it fine to leave them undocumented in my case?
-- Vladimir Prus http://vladimirprus.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk