Tagged articles
17 articles
Page 1 of 1
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 21, 2025 · Fundamentals

Understanding CAS: Solving the ABA Problem and Other Pitfalls in Java Concurrency

This article explains the classic ABA issue in Java's Compare‑And‑Swap (CAS) operations, outlines why long spin loops and single‑variable limitations can degrade performance, and presents practical solutions such as AtomicStampedReference, LockSupport, ReentrantLock, and optimized data structures to mitigate these challenges.

ABA problemCASJava concurrency
0 likes · 4 min read
Understanding CAS: Solving the ABA Problem and Other Pitfalls in Java Concurrency
Architecture & Thinking
Architecture & Thinking
Oct 10, 2024 · Backend Development

How CAS Solves High-Concurrency Consistency Issues and the Hidden ABA Problem

This article examines typical high‑concurrency scenarios such as payment processing, online ordering, and cross‑bank transfers, introduces the Compare‑and‑Swap (CAS) approach to ensure strong consistency, explains the ABA problem it can cause, and presents application‑level and data‑layer strategies—including versioning and SQL examples—to mitigate it.

ABA problemCASDistributed Transactions
0 likes · 9 min read
How CAS Solves High-Concurrency Consistency Issues and the Hidden ABA Problem
Architect
Architect
Sep 23, 2024 · Backend Development

Ensuring Idempotency in Order Services: Preventing Duplicate Orders and Solving the ABA Problem

This article explains how to achieve idempotent order creation and updates by using unique request identifiers, database primary‑key constraints, Redis flags, and optimistic locking with version columns, thereby preventing duplicate orders and solving the ABA problem in distributed backend systems.

ABA problemIdempotencyoptimistic locking
0 likes · 11 min read
Ensuring Idempotency in Order Services: Preventing Duplicate Orders and Solving the ABA Problem
Architecture Digest
Architecture Digest
Dec 12, 2023 · Backend Development

Ensuring Idempotency and Solving the ABA Problem in Order Services

This article explains how to achieve idempotent order creation and updates in backend services by using database transactions, unique request identifiers, Redis flags, and optimistic locking with a version column to prevent duplicate submissions and solve the ABA problem.

ABA problemIdempotencyoptimistic locking
0 likes · 10 min read
Ensuring Idempotency and Solving the ABA Problem in Order Services
Java Backend Technology
Java Backend Technology
Aug 15, 2023 · Backend Development

How to Ensure Order Service Idempotency and Prevent Duplicate Orders

This article explains how to achieve idempotent order creation and updates in backend services by using unique request identifiers, database unique constraints, Redis flags, and optimistic locking with version columns, while also addressing the ABA problem with practical code examples and diagrams.

ABA problemIdempotencyoptimistic locking
0 likes · 10 min read
How to Ensure Order Service Idempotency and Prevent Duplicate Orders
JavaEdge
JavaEdge
Sep 3, 2022 · Backend Development

How to Ensure Idempotent Order Creation and Prevent ABA Issues in Distributed Systems

This article explains why order creation and payment APIs must be idempotent, outlines practical techniques such as unique request IDs, database unique constraints, Redis flags, and version‑based optimistic locking to avoid duplicate orders and solve the ABA problem in distributed environments.

ABA problemDistributed SystemsIdempotency
0 likes · 9 min read
How to Ensure Idempotent Order Creation and Prevent ABA Issues in Distributed Systems
Senior Brother's Insights
Senior Brother's Insights
Jul 21, 2022 · Backend Development

Mastering Java CAS: How AtomicInteger Achieves Lock‑Free Concurrency

This article explains the fundamentals of Compare‑And‑Swap (CAS), its implementation in Java through the Unsafe class, demonstrates AtomicInteger's lock‑free operations, and discusses CAS drawbacks such as spin‑wait overhead, single‑variable limitation, and the ABA problem with mitigation strategies.

ABA problemAtomicIntegerCAS
0 likes · 15 min read
Mastering Java CAS: How AtomicInteger Achieves Lock‑Free Concurrency
Code Ape Tech Column
Code Ape Tech Column
May 17, 2022 · Fundamentals

Understanding Compare‑And‑Swap (CAS), Its Mechanisms, and Common Pitfalls

This article explains the fundamentals of the compare‑and‑swap (CAS) atomic primitive, how CPUs guarantee its atomicity through bus and cache locking, illustrates a Java spin‑lock implementation using CAS, and discusses typical issues such as single‑variable limitation, long spin times, and the ABA problem with mitigation strategies.

ABA problemCASJava
0 likes · 9 min read
Understanding Compare‑And‑Swap (CAS), Its Mechanisms, and Common Pitfalls
21CTO
21CTO
Jan 12, 2021 · Fundamentals

How to Build a Lock‑Free Queue Using CAS: Step‑by‑Step Guide

This article explains the fundamentals of lock‑free queues, covering CAS and other atomic operations, detailed enqueue and dequeue implementations, the ABA problem and its solutions, as well as array‑based lock‑free queue designs, providing code examples and practical insights.

ABA problemCASatomic operations
0 likes · 15 min read
How to Build a Lock‑Free Queue Using CAS: Step‑by‑Step Guide