MCQsAdvanced MCQsConcurrency and SynchronizationConcurrency and Synchronization 1).What is concurrency in C++?1) Executing multiple tasks in parallel2) Executing multiple tasks without overlap3) Executing tasks in a sequential order4) None of the above 2).Which of the following is used for synchronizing threads in C++?1) std::mutex2) std::thread3) std::async4) std::condition_variable 3).What does 'std::mutex' do in C++?1) It provides mutual exclusion to avoid race conditions2) It allows for asynchronous execution3) It blocks threads from execution4) None of the above 4).Which function is used to lock a mutex in C++?1) lock()2) unlock()3) try_lock()4) None of the above 5).What is 'std::condition_variable' used for?1) For synchronizing threads and notifying one thread to proceed2) To pause a thread3) For avoiding race conditions4) None of the above 6).What happens if a thread tries to lock an already locked mutex?1) The thread waits until the mutex is unlocked2) The thread proceeds without waiting3) The thread throws an exception4) None of the above 7).What is a deadlock in multi-threading?1) When threads are waiting for each other to release resources2) When a thread is not executing3) When threads execute in a single sequence4) None of the above 8).Which of the following can prevent deadlocks in C++?1) Using timeouts for locks2) Avoiding circular wait3) Using mutexes in the same order4) All of the above 9).What is a semaphore used for?1) To control access to shared resources2) To monitor thread execution time3) To synchronize thread priorities4) None of the above 10).What is 'std::lock_guard' in C++?1) A class that automatically locks and unlocks a mutex2) A function that locks multiple mutexes3) A method to lock a mutex manually4) None of the above