I want some clarity on the use of semaphores in thread synchronization.
I have seen a lot of code that shows how to implement a semaphore but can’t find something similar to an inbuilt class like std::mutex.
Do we have something like std::semaphore somewhere? Or am I just plain confused??
I know that a binary semaphore behaves similar to a mutex & that we have counting_semaphore, etc in C++20. But why was it not available in C++ 11?
Are semaphores just a concept that need to be implemented by the user, using mutexes and condition variables?