Signalling and Resource Counting Using Semaphores
Learn how semaphores can be used for signaling and resource counting.
We'll cover the following...
We'll cover the following...
Semaphores
The word semaphore means something that can be used for signaling, such as a flag or a light. In the example that follows, we will see how we can use semaphores for signaling different states that other threads can be waiting for.
A semaphore can also be used to control access to a resource, similarly to how a std::mutex restricts access to a critical section: