Synchronization
Everything on SkillVeris tagged Synchronization — collected across the glossary, study notes, blog, and cheat sheets.
31 resources across 2 libraries
Study Notes(2)
Synchronization in Java
Learn how the synchronized keyword prevents race conditions in Java by using intrinsic locks on objects and classes, and how deadlocks can arise.
Classical Synchronization Problems
Study the Producer-Consumer, Readers-Writers, and Dining Philosophers problems and their semaphore-based solutions.
Interview Questions(29)
Difference Between Process and Thread
A process is an independent program in execution with its own private memory space, while a thread is a lighter unit of execution that lives inside a process a…
What is a Deadlock?
A deadlock is a situation where a set of processes are permanently blocked because each holds a resource the others need and is waiting for a resource another…
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 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…
What is Inter-Process Communication (IPC)?
Inter-process communication (IPC) is the set of mechanisms an operating system provides for separate processes — each with its own isolated address space — to…
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…
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…
The Readers-Writers Problem Explained
The readers-writers problem is a synchronization challenge where multiple reader threads may safely access shared data concurrently, but a writer thread must h…
The Dining Philosophers Problem Explained
The dining philosophers problem is a classic model of resource deadlock and starvation where five philosophers sit around a table sharing five forks, each need…
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…
What is a Condition Variable?
A condition variable is a synchronization primitive that lets a thread block until another thread signals that some shared condition has become true, always us…
What is Priority Inversion?
Priority inversion is a scheduling hazard where a high-priority task is indirectly blocked by a low-priority task holding a lock it needs, while an unrelated m…
What is a Livelock?
A livelock is a condition where two or more threads keep changing their state in response to each other purely to avoid a conflict, so both stay actively busy…
What is Barrier Synchronization?
Barrier synchronization is a coordination mechanism where every thread in a group must reach a defined checkpoint before any of them is allowed to proceed past…
What is the Compare-and-Swap (CAS) Instruction?
Compare-and-swap (CAS) is an atomic CPU instruction that reads a memory location, compares it to an expected value, and only writes a new value if the comparis…
How is a Mutex Lock Actually Implemented?
A mutex is implemented as a memory word holding a locked/unlocked flag plus a wait queue, where acquiring it uses an atomic instruction such as compare-and-swa…
What is Busy Waiting and Why is it Costly?
Busy waiting is when a thread repeatedly checks a condition in a tight loop instead of yielding the CPU or being put to sleep, which wastes CPU cycles and star…
What Are Atomic Operations in an Operating System?
An atomic operation is one that executes as a single, indivisible step from the perspective of every other thread or CPU core, so no concurrent operation can e…
What is a Thread Pool and Why Use One?
A thread pool is a fixed or bounded group of pre-created worker threads that pull tasks from a shared queue, so an application avoids the cost of spawning and…
Showing 24 of 29.