1. What is multi-threading in C++? A. A process that allows parallel execution of tasks B. A process that allows a single thread to execute C. A process that allows multiple processes to execute concurrently D. A process that allows multiple threads to execute concurrently 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
2. Which header file is used for multi-threading in C++? A. <mutex> B. <condition_variable> C. <thread> D. <atomic> 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
3. What is the maximum number of threads that can run concurrently in C++? A. 2 B. Depends on the hardware and operating system C. 4 D. 8 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
4. What is the purpose of the 'std::thread' class in C++ multi-threading? A. To define thread-specific data B. To manage thread priorities C. To create and manage threads D. To synchronize access to shared resources 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
5. Which of the following is a common synchronization primitive in C++ multi-threading? A. Semaphore B. Barrier C. Spinlock D. Mutex 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
6. What is a race condition in multi-threading? A. A condition where the outcome of a program depends on the order of thread execution B. A condition where multiple threads try to access shared resources simultaneously C. A condition where threads wait indefinitely for a signal D. A condition where threads execute in parallel 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
7. Which function is used to join a thread in C++ multi-threading? A. join() B. wait() C. sync() D. connect() 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
8. What is the purpose of the 'std::mutex' class in C++ multi-threading? A. To manage thread priorities B. To synchronize thread execution C. To notify waiting threads D. To provide mutual exclusion 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
9. What is deadlock in multi-threading? A. A situation where a thread blocks other threads from executing B. A situation where threads execute out of order C. A situation where two or more threads are waiting indefinitely for each other to release resources D. A situation where threads race to access shared resources 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
10. Which of the following is used to avoid race conditions in C++ multi-threading? A. Mutex B. Semaphore C. Condition variable D. All of the above 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