What this C++ concurrency question tests
This is a medium-difficulty question on asynchronous execution in C++. It requires you to reason carefully about the semantics of async task launch policies and how they affect when and where code actually runs.
The question probes whether you understand the difference between deferred execution, immediate asynchronous spawning, and the implicit synchronization boundaries that arise when futures are destroyed or explicitly waited on. These distinctions matter in production systems where thread overhead and scheduling behaviour have real performance consequences.
- std::async launch policies (std::launch::async, std::launch::deferred, and their interaction)
- Future lifetime and destruction semantics
- Thread creation and task scheduling guarantees
- Synchronization points in asynchronous code