std::launch
STD:启动
Defined in header | | |
---|---|---|
enum class launch : /* unspecified */ { async = /* unspecified */, deferred = /* unspecified */, /* implementation-defined */ }; | | (since C++11) |
对象执行的任务的启动策略。std::async
功能。std::launch
是用作BitmaskType
...
标准库定义了表示单个位的下列常量:
Constant | Explanation |
---|---|
std::launch::async | a new thread is launched to execute the task asynchronously |
std::launch::deferred | the task is executed on the calling thread the first time its result is requested (lazy evaluation) |
此外,还允许实现:
- 定义额外的位位和位掩码,以指定适用于启动策略子集的任务交互的限制,以及
- 为第一个%28默认%29重载启用这些额外的位掩码。
std::async
...
另见
async (C++11) | runs a function asynchronously (potentially in a new thread) and returns a std::future that will hold the result (function template) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。