The interface for std::future::then
in the paper N3784 included an overloaded version that accepted an executor (described more here in N3562) as a parameter. So if you wanted more control over which thread the callback was executed on you could do so.
But the official document that goes over all the features that are in the concurrency TS here http://ift.tt/2qgUWxi does not include that overload for .then() and doesn't mention executors at all. It says
When the object's shared state is ready, the continuation
INVOKE(DECAY_COPY(std::forward<F>(func))
,std::move(*this))
is called on an unspecified thread of execution with the call toDECAY_COPY()
being evaluated in the thread that called then.
Why does the interface not offer precise control of how the closure is executed? Why the change from the proposed version?
Note I am not sure if the concurrency TS paper I linked to is the latest one, but cppreference does not mention executor
s anywhere either
Aucun commentaire:
Enregistrer un commentaire