
Bjorn Reese <breese <at> mail1.stofanet.dk> 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 called). Evan Wallace