Startup Policy std::launch::async | std::launch::deferred
std::launch::async | std::launch::deferred
means that the implementation can choose whether to apply the std::launch::async
or std::launch::deferred
policies. This choice may differ from call to call and cannot be resolved immediately.
An implementation that always selects one or the other is legal (this is what gcc does, always choosing a deferred one), like the one that selects std::launch::async
before reaching a certain limit, and then switches to std::launch::deferred
.
It also means that an implementation may delay the choice until the end. This means that an implementation can wait for a decision to be made until its hand is forcibly called by a call that has clearly different effects from deferred and asynchronous tasks, or until the number of tasks performed is less than the internal limit of the task. This is what just :: thread does.
Functions that call the solution: wait()
, get()
, wait_for()
, wait_until()
and the destructor of the last future object that refers to the result.
source share