Opened 2 years ago

Closed 2 years ago

#11734 closed Feature Requests (fixed)

future::then(Cont) should be able to execute the contination on undetermined thread

Reported by: viboes Owned by: viboes
Milestone: Boost 1.60.0 Component: thread
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

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




f.then(launch::inherit, c);

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by viboes

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:2 Changed 2 years ago by viboes

Description: modified (diff)

comment:5 Changed 2 years ago by viboes

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.