Vidyalelo
C++ Programming · all questions

Multi threading in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

42

Questions

2/3

Page

Pick an option on a question to see the right answer and solution.

What is the purpose of the 'std::future' class in C++ multi-threading?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the purpose of the 'std::promise' class in C++ multi-threading?

Select an option to see the answer and solution.

What is the difference between std::condition_variable and std::condition_variable_any in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::thread::hardware_concurrency()' function in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::recursive_mutex' class in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::atomic_flag' class in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::latch' class in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::barrier' class in C++ multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::semaphore' class in C++ multi-threading?

Select an option to see the answer and solution.

Which of the following is not a synchronization mechanism in C++ multi-threading?

Select an option to see the answer and solution.

What does the term "thread-safe" mean in the context of multi-threading?

Select an option to see the answer and solution.

What is the primary purpose of a mutex in C++ multi-threading?

Select an option to see the answer and solution.

Which of the following is true about a condition variable in C++ multi-threading?

Select an option to see the answer and solution.

What is a deadlock in the context of multi-threading?

Select an option to see the answer and solution.

Which C++11 feature introduced support for multi-threading?

Select an option to see the answer and solution.

What is the difference between std::mutex and std::recursive_mutex in C++ multi-threading?

Select an option to see the answer and solution.

Which of the following is not a potential issue in multi-threading?

Select an option to see the answer and solution.

What is the purpose of the 'std::this_thread::sleep_for' function in C++ multi-threading?

Select an option to see the answer and solution.

What is the primary difference between a std::mutex and a std::spinlock in C++ multi-threading?

Select an option to see the answer and solution.