Boost logo

Boost :

Subject: Re: [boost] Executor associated to the future continuations (was [thread] boost::future::then)
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-10-29 10:14:06


Le 29/10/15 14:34, Vladimir Prus a écrit :
> On 29-Oct-15 4:09 PM, Vicente J. Botet Escriba wrote:
>
>>> I'm worried that Executor interface requires methods like
>>>>> close/closed,
>>>> This is used to shutdown smoothly the worker threads.
>>>
>>> So where will ::close be called? Is it ever called from
>>> boost::thread? That seems unlikely, since boost::thread
>>> does not know at which point I no longer need an executor. And if
>>> boost::thread does not call this,
>>> why am I required to implement this method at all?
>> Some executors call close in the destructor before joining all the
>> threads.
>> In addition the use can request to close the submission of new work.
>>
>> If needed we can move this also to another Executor layer, so that
>> Executors can be created without close()/closed().
>
> Yes, that would make sense. I found it a tad confusing that a concept
> requires some methods that I'd have to call
> myself. Usually, a concept requires only the method that the library
> will actually call.
You are right. I'll check where these are
close/closed()/try_executing_one/ are needed for the concept and the
polymorphic interface.

Vicente


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