Cisco CloudCenter: Get the Hybrid IT Advantage


Definition - What does Semaphore mean?

A semaphore is a synchronization object that controls access by multiple processes to a common resource in a parallel programming environment. Semaphores are widely used to control access to files and shared memory. The three basic functionalities associated with semaphores are set, check and wait until it clears to set it again. |

Semaphores are used to address benchmark synchronization problems.

The concept of semaphore was put forth by the Dutch computer scientist Edsger Dijkstra.

Techopedia explains Semaphore

Semaphores are non-negative integer values that support the operations semaphore->P () and semaphore->V (). P is an atomic operation that waits for a semaphore to be positive and then decrements it by one, while V is an atomic operation that increments a semaphore by one, which implies it wakes up a waiting P. Test and set associated with semaphore are routines implemented in hardware to coordinate lower-level critical sections.

Semaphores are normally implemented using file descriptors. Semaphore creations are not atomic. If two processes try to create, initialize and use a semaphore at the same time, a race condition is created. Semaphores are created and initialized to a positive value to show the availability of a resource to be used. Semaphores can be implemented through interrupts or by using test-set operations.

Every semaphore maintains sets of permits. It restricts the number of threads accessing the resources. Semaphores with only one permit and initialized to one serve as mutual exclusion locks. They are referred to as such because they have only two states: permit available or zero permit available. This encloses the property so that a lock can be released by a thread other than the owner, helping in deadlock recovery. Semaphores are used for mutual exclusions where the semaphore has an initial value of one, and P () and V () are called before and after the critical sections.

Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.