Thread Safety
Everything on SkillVeris tagged Thread Safety — collected across the glossary, study notes, blog, and cheat sheets.
12 resources across 1 library
Interview Questions(12)
How Would You Design a Concurrent Hash Map?
A concurrent hash map achieves thread-safe reads and writes at scale by splitting the table into independently lockable segments (or per-bucket locks) instead…
What is the Singleton Pattern?
The Singleton pattern restricts a class to exactly one instance and provides a single global access point to that instance, typically via a static method.
What is Immutability in OOP?
Immutability means an object’s observable state cannot change after it is constructed — every field is fixed for the lifetime of the object, so any operation t…
Thread Safety in the Singleton Pattern
Thread safety in the Singleton pattern means guaranteeing that when multiple threads call the accessor concurrently before the instance exists, only one instan…
What is a Thread-Safe Singleton?
A thread-safe Singleton is an implementation of the Singleton pattern that guarantees exactly one instance is created and visible to every thread even when mul…
What is Lazy Initialization in OOP?
Lazy initialization is the technique of deferring the creation of an expensive object or the computation of a value until the exact moment it is first actually…
Eager vs Lazy Initialization in OOP
Eager initialization creates an object’s dependencies or resources up front, at declaration or construction time, while lazy initialization defers creation unt…
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…
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…
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…
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…