Object-oriented semaphores are not part of the C++ standard at this point. However, it is possible to implement a semaphore class using a mutex and a condition variable both of which where added to the standard in C++11.


A singleton controls the number of objects which may be created from this class. A singleton object is global and accessible from everywhere in your code.