11. What is the purpose of the 'std::condition_variable' class in C++ multi-threading? A. To notify waiting threads B. To synchronize the execution of threads C. To manage thread priorities D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
12. Which of the following is true about thread safety in C++ multi-threading? A. Thread safety ensures that threads do not race B. Thread safety ensures that threads do not deadlock C. Thread safety ensures that data accessed by multiple threads is synchronized D. Thread safety guarantees that threads execute in parallel Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
13. What is the purpose of the 'std::atomic' class in C++ multi-threading? A. To manage thread priorities B. To synchronize thread execution C. To notify waiting threads D. To perform atomic operations on shared variables Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
14. Which of the following is used to implement a barrier in C++ multi-threading? A. std::barrier B. std::mutex C. std::condition_variable D. std::atomic Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
15. What is the purpose of the 'std::async' function in C++ multi-threading? A. To manage thread priorities B. To synchronize access to shared resources C. To join two threads asynchronously D. To create a new thread and execute a function asynchronously Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
16. Which of the following is a thread management library in C++? A. pthread B. std::thread C. thread.h D. concurrent.h Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
17. What is the purpose of the 'std::lock_guard' class in C++ multi-threading? A. To block the execution of a thread B. To signal waiting threads C. To acquire and release a mutex automatically D. To synchronize thread execution Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
18. What is the purpose of the 'std::unique_lock' class in C++ multi-threading? A. To manage thread priorities B. To provide more flexibility than std::lock_guard C. To handle exceptions in threads D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
19. What is the purpose of the 'std::condition_variable_any' class in C++ multi-threading? A. To provide mutual exclusion B. To synchronize the execution of threads C. To wait for a condition to be satisfied by any type of mutex D. To signal waiting threads Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
20. What is the purpose of the 'std::packaged_task' class in C++ multi-threading? A. To execute a task asynchronously B. To provide mutual exclusion C. To manage thread priorities D. To package a task and its associated state Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board