Subject: [Boost-bugs] [Boost C++ Libraries] #11734: future::then(Cont) should be able to execute the contination on undetermined thread
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-17 13:16:33
#11734: future::then(Cont) should be able to execute the contination on
undetermined thread
------------------------------+----------------------
Reporter: viboes | Owner: anthonyw
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
------------------------------+----------------------
Concurrency TS defines future::then() as
"the continuation
`INVOKE(DECAY_COPY(std::forward<F>(func)), std::move(*this))` is called on
an unspecified thread
of execution with the call to `DECAY_COPY()` being evaluated in the thread
that called then".
`boost::future<T>::then()` has more overloads than Concurrency TS. However
when not requested explicitly then Boost.Thread should conform to the
proposed standard.
As Concurrency TS doesn't have neither `async`, the future can be created
only by a `promise` or a a `packaged_task`, so that there are neither
futures with launch policy async nor deferred.
In order to be as clear as possible, boost::future<T>::then(Cont) can call
the continuation on an unspecified thread of execution.
If the user want other behavior, it can use then(launch_policy, Cont) or
then(Executor, Cont) must wrap the continuation.
However the current specification inherit from the parent future when
there is no executor nor launch policy.
If there is an interest and in order to provide the current behavior even
with a different interface we can add an inherit policy
Before
{{{
f.then(c);
}}}
After
{{{
f.then(launch_policy::inherit, c);
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11734> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC