Critical Section
Everything on SkillVeris tagged Critical Section — collected across the glossary, study notes, blog, and cheat sheets.
9 resources across 1 library
Interview Questions(9)
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 a Race Condition?
A race condition occurs when two or more threads or processes access shared data concurrently and the final outcome depends on the unpredictable timing of thei…
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…
Peterson’s Solution for Mutual Exclusion
Peterson’s solution is a software-only algorithm for two processes that guarantees mutual exclusion, progress, and bounded waiting using only two shared variab…
What is the Test-and-Set Instruction?
Test-and-set is a hardware-atomic CPU instruction that reads a memory location, sets it to true, and returns the old value, all as one indivisible operation, w…
What is a Spinlock?
A spinlock is a locking mechanism where a thread that cannot acquire the lock repeatedly polls it in a tight busy-wait loop instead of yielding the CPU or slee…
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…
How Does Distributed Mutual Exclusion Work?
Distributed mutual exclusion ensures that only one process across an entire network of machines enters a critical section at a time, achieved without shared me…