Software Engineering KB

Home

❯

02 Programming Languages and Paradigms

❯

04 Concurrency

❯

01 Concept

❯

Compare and Swap (CAS)

Compare-and-Swap (CAS)

Feb 10, 20261 min read

  • concurrency
  • lock-free
  • cas

Compare-and-Swap (CAS)

← Back to Lock-Free & Wait-Free Programming

An atomic hardware instruction that compares a memory location with an expected value and, only if they match, atomically replaces it with a new value. CAS is the fundamental building block of all lock-free data structures and algorithms.

Key Properties

  • Atomic Read-Modify-Write
  • Basis of Lock-Free Data Structures

concurrency lock-free cas


Graph View

  • Compare-and-Swap (CAS)
  • Key Properties

Backlinks

  • Lock-Free & Wait-Free Programming
  • Atomic Read-Modify-Write
  • Basis of Lock-Free Data Structures

Created with Quartz v4.5.2 © 2026

  • GitHub