Vidyalelo
C++ Programming · Q22

Multi threading in C++

Programming · C++ Programming · question 22

Q22

What is the difference between std::async and std::thread in C++ multi-threading?

A.
std::async returns a std::future object representing the result of the asynchronous operation, while std::thread does not return anything
B.
std::thread allows you to specify the execution policy, while std::async does not
C.
std::async creates a new thread and executes a function asynchronously, while std::thread simply creates a new thread
Answer
D.
std::thread provides more control over thread creation and management compared to std::async

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board