Semaphore
Everything on SkillVeris tagged Semaphore — collected across the glossary, study notes, blog, and cheat sheets.
11 resources across 1 library
Interview Questions(11)
What is a Semaphore?
A semaphore is a synchronization primitive — an integer counter with atomic wait (P/down) and signal (V/up) operations — used to control access to shared resou…
Difference Between Mutex and Semaphore
A mutex is a locking primitive owned by exactly the thread that acquires it and enforces mutual exclusion over a single resource, while a semaphore is a counte…
What is the Critical Section Problem?
The critical section problem is the challenge of designing a protocol that lets multiple concurrent processes or threads take turns using a shared resource saf…
What is the Producer-Consumer Problem?
The producer-consumer problem is a classic synchronization challenge where one or more producer threads generate data into a shared, fixed-size buffer while on…
What Is a Monitor in OS?
A monitor is a high-level synchronization construct that bundles shared data with the procedures that operate on it, guaranteeing that only one thread can exec…
What is the Sleeping Barber Problem?
The sleeping barber problem is a classic synchronization exercise where a barber sleeps when there are no customers and must be woken when one arrives, while a…
Overview of Synchronization Primitives: Mutex, Semaphore, Condition Variable, Spinlock
Synchronization primitives are the building blocks — mutexes, semaphores, condition variables, and spinlocks — that operating systems and languages provide to…
What is Shared Memory IPC?
Shared memory IPC is a technique where the OS maps the same physical memory frames into the address spaces of two or more processes, letting them read and writ…
Why Does IPC Require Synchronization?
IPC requires synchronization because independent processes execute concurrently with no inherent guarantee about relative timing, so without coordination they…
How is a Semaphore Implemented Internally?
A semaphore is implemented as an integer counter protected by an atomic update, paired with a kernel-managed wait queue: the wait (P) operation atomically decr…
Binary Semaphore vs Counting Semaphore
A binary semaphore holds only two states, 0 and 1, and is used to guard a single resource much like a mutex, while a counting semaphore holds an integer that c…