Boost logo

Boost :

Subject: Re: [boost] [GSoC] Boost.Thread executors proposal
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-03-15 15:08:20


Le 15/03/14 18:20, Ian Forbes a écrit :
>> First provide in addition a static polymorphic interface. The template
>> functions submit_at and submit_after would accept any chrono
>> `time_point` and `duration`.
> Is this with respect to the granularity of the time point? e.g. nano/micro/mille etc?
No, forget the granularity parameter on Boost.Thread.
> If it is I'm assuming this would take an executor and then convert the time point to the desired granularity (nanoseconds by default) then add it to the executor.
Yes.
>
>> Second, provide an adaptor that wraps an scheduled executor and makes it
>> a polymorphic one.
> Polymorphic with respect to what?
N3785 defines a class scheduled_executor that is used polymorphically.
The scheduled_executor_adaptor would inherit from this scheduled_executor.

>
>> Third, provide an adaptor that wraps an executor, manage the time based
>> operations using a specific thread and forward all the operations to the
>> wrapped executor.
> So this would take a reference to an executor or a shared_ptr then spawn a single thread that would loop and add the submitted closures at the desired time to the given executor?
>
>
Yes, this is a possibility. In this way you can have timed-based task on
e.g. a serial executor or any of them.
The other is that the adaptor takes two references one to a scheduled
executor and the other to an executor. This design allows to share the
management of time-based operations between several executors.

Vicente


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