What is std::async and how does it differ from creating a std::thread directly?

Last updated 21 June 2026

  • std::async runs a callable and returns a std::future. Calling get() yields the result or rethrows the task's exception. A raw std::thread has no return channel and an uncaught exception calls std::terminate.

  • Launch policy: std::launch::async forces a new thread, while std::launch::deferred runs lazily at get(). The default may pick either, so be explicit.

  • A std::thread must be join()ed or detach()ed or the program terminates. The async future instead blocks in its destructor until the task finishes.

  • https://github.com/StrayDragon/awesome-stars
  • https://github.com/jiegec/awesome-stars/blob/master/README.md
All C++ interview questions