...

/

Overview of Semaphores

Overview of Semaphores

Get a brief introduction of semaphores.

We'll cover the following...

Semaphores are a synchronization mechanism used to control concurrent access to a shared resource. A counting semaphore is a special semaphore that has a counter that is bigger than zero. The counter is initialized in the constructor. Acquiring the semaphore decreases the counter and releasing the semaphore increases the counter. If a thread tries to acquire the semaphore when the counter is zero, the thread will block until another thread increments the counter by releasing the semaphore.

🔑 Edsger W. Dijkstra invented semaphores

The Dutch computer scientist Edsger W. Dijkstra presented the concept of a semaphore in 19651965 ...