Subject: Re: [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 22:26:17
#11734: future::then(Cont) should be able to execute the contination on
undetermined thread
-------------------------------+----------------------
Reporter: viboes | Owner: viboes
Type: Feature Requests | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------
Description changed by viboes:
Old description:
> 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);
> }}}
New description:
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::inherit, c);
}}}
-- -- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11734#comment:2> 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