| Start |
|---|
| std::future and std::promise The following example sets a promise to be consumed by another thread: |
| Deferred async example This code implements a version of |
| std::packaged_task and std::future
The thread starts running immediately. We can either detach it, or have join it at the end of the scope. When the function call to std::thread finishes, the result is ready. Note that this is slightly different from |
| std::future_error and std::future_errc If constraints for std::promise and std::future are not met an exception of type std::future_error is thrown. The error code member in the exception is of type std::future_errc and values are as below, along with some test cases: Inactive promise: Active promise, unused: Double retrieval: Setting std::promise value twice: |
| std::future and std::async In the following naive parallel merge sort example, Note: In the example
The default policy is |
Async operation classes
|
Read Article
https://develop.horje.com/learn/1434/reference