What is the purpose of the 'std::semaphore' class in C++ multi-threading?
A. To manage thread priorities
B. To synchronize the execution of threads
C. To provide mutual exclusion
D. To control access to a shared resource by multiple threads
Answer: Option D

Join The Discussion