Compare And Swap
Everything on SkillVeris tagged Compare And Swap — collected across the glossary, study notes, blog, and cheat sheets.
6 resources across 1 library
Interview Questions(6)
What Are Lock-Free Data Structures?
A lock-free data structure guarantees system-wide progress without using mutexes, by relying on atomic hardware primitives like compare-and-swap (CAS) so that…
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 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…
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 Hardware Support Exists for Process Synchronization?
Hardware support for process synchronization refers to CPU instructions — such as Test-and-Set, Swap (Exchange), and Compare-and-Swap — that execute as a singl…
How is a Mutex Implemented Internally?
A mutex is implemented as a small in-memory state word — typically a lock bit plus a waiter count or queue — manipulated through an atomic hardware instruction…