Boost logo

Boost :

Subject: Re: [boost] [thread] request for interest in new c++1y features
From: Evan Wallace (onlyone_at_[hidden])
Date: 2012-10-20 11:03:11

Bjorn Reese <breese <at>> writes:
> The future.then proposal looks very useful.
> It is unclear to me, however, what happens if the async call returns
> before .then is hooked up. Will the .then function be executed in the
> calling thread?

The answer to this depends on the situation. The paper states that
"The continuation launches according to the specified policy or scheduler".

I would interpret this to mean that the continuation is run as if by a call
to std::async in the first thread to have both a .then continuation set
and a value available (so -- in the .then thread if the future already
contains a result at the time of the call to .then, and in the thread that
fills the future, if the future did not yet contain a result when .then was

Evan Wallace

Boost list run by bdawes at, gregod at, cpdaniel at, john at