Tagged articles
atomic-operations
24 articles · Page 1 of 1
This article demystifies lock‑free queues by explaining their low‑level implementation, atomic operations, memory barriers, and the four SPSC/MPMC models, while also covering ABA problems, false sharing avoidance, and practical C++ code examples to help developers truly understand high‑concurrency fundamentals.
C++CASConcurrency
0 likes · 44 min read

This article explains the unique challenges of flash‑sale systems—massive, short‑lived traffic spikes—and presents practical backend optimizations such as front‑end request filtering, Redis‑based atomic counters, streaming queues, safe database updates, and unit‑level isolation for global deployments.
Redisatomic-operationsbackend optimization
0 likes · 8 min read

This article explains how programming‑language memory models define the guarantees for shared‑memory concurrency, illustrates common pitfalls such as ordinary‑variable problems and instruction‑reordering, and surveys the evolution of memory models in Java, C++, Rust, Swift, JavaScript and hardware architectures.
C++ConcurrencyJava
0 likes · 38 min read

This article explains how the Linux kernel ensures safe concurrent access to shared resources through various synchronization mechanisms such as atomic operations, spinlocks, mutexes, read‑write locks, and semaphores, illustrating their concepts, APIs, and practical usage with code examples.
atomic-operationskernelspinlock
0 likes · 42 min read

This article explains how to integrate Lua scripts into Spring Boot applications with Redis, covering Lua fundamentals, advantages of Lua in Redis, practical use cases, step‑by‑step implementation in Spring Boot, performance optimizations, error handling, security considerations, and best practices for reliable backend development.
BackendLuaRedis
0 likes · 23 min read

This article explains C++11’s memory model and atomic types, demonstrating how lock‑free concurrency, memory ordering, and synchronization primitives such as fences can be used to achieve high‑performance, race‑free multithreaded code for demanding backend systems like game servers.
C++ConcurrencyLock-Free Programming
0 likes · 26 min read

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 problemCASVersioning
0 likes · 9 min read

This article explains the structure and operation of modern CPU multi‑level caches, the write‑back caching policy, cache‑coherence mechanisms, atomic operations, and various memory‑ordering models in C++ multithreaded programs, providing detailed concepts, hardware and software solutions, and practical code examples.
C++Multithreadingatomic-operations
0 likes · 32 min read

This article demystifies thread safety by comparing private and shared resources, defining when code is thread‑safe, illustrating common pitfalls with C/C++ examples, and presenting practical techniques such as using thread‑local storage, read‑only globals, atomic operations, and synchronization to write reliable multithreaded programs.
Multithreadingatomic-operationsshared resources
0 likes · 16 min read


IT NiukeJan 20, 2024 · Backend Development
This article explains Lua fundamentals, why Lua is advantageous inside Redis, common use‑cases such as cache updates and distributed locks, and provides step‑by‑step guidance for integrating and executing Lua scripts in a Spring Boot application to improve performance and ensure atomicity.
LuaLua scriptingRedis
0 likes · 22 min read

The article systematically explains Linux kernel synchronization primitives—from basic atomic operations through queued spinlocks, counting semaphores, and sleeping mutexes to read‑write semaphores and per‑CPU variants—detailing their underlying data structures, memory‑barrier semantics, and the fast‑path and slow‑path acquisition and release APIs.
Linux kernelMutexSemaphore
0 likes · 13 min read

This article introduces Java's sun.misc.Unsafe class, explains its memory, CAS, thread, class, and object manipulation APIs, shows how to obtain an Unsafe instance, and provides practical code examples for low‑level operations such as field offsets, compare‑and‑swap, object allocation, and custom atomic counters.
ConcurrencyJavaLow-Level Programming
0 likes · 9 min read


ITPUBFeb 7, 2023 · Backend Development
This article explains why Redis is essential for flash‑sale (秒杀) systems, detailing the load characteristics, the three sale phases, stock‑checking and decrement strategies, atomic operations, distributed locks, data modeling, and practical deployment recommendations for high‑concurrency back‑end services.
Distributed LockRedisatomic-operations
0 likes · 11 min read


JavaEdgeJan 25, 2023 · Backend Development
This article explains why Redis is essential for flash‑sale systems, detailing load characteristics, the three sale phases, Redis features such as high concurrency and atomic operations, and practical implementations using Lua scripts and distributed locks to ensure safe stock checking and deduction.
Distributed LockRedisatomic-operations
0 likes · 12 min read

This article explains which instruction sets support atomic operations, detailing the principles behind x86’s LOCK prefix and ARM’s exclusive load/store mechanisms, illustrating how single‑processor and SMP systems handle atomicity, and showing Linux kernel implementations for atomic increment and compare‑and‑swap.
ARMInstruction Setatomic-operations
0 likes · 11 min read

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 problemCASConcurrency
0 likes · 9 min read


政采云技术Apr 28, 2022 · Fundamentals
This article explores thread blocking and waking mechanisms in Java using LockSupport and Unsafe, explaining how these low-level tools enable thread scheduling without traditional locks.
Java ConcurrencyLockSupportUnsafe class
0 likes · 15 min read

This article dives deep into Java's ConcurrentHashMap, explaining how it uses CAS, volatile fields, lock‑striping and cooperative resizing to provide thread‑safe get, put and size operations while maximizing concurrency and performance.
CASConcurrentHashMapJava
0 likes · 33 min read

This article presents a comprehensive translation of the Swift Evolution proposal SE‑0282, detailing the design and implementation of low‑level atomic operations, memory orderings, and related types such as UnsafeAtomic and UnsafeAtomicLazyReference, providing examples and discussing integration with Swift’s concurrency model.
ConcurrencyLow-Level ProgrammingSWIFT
0 likes · 57 min read

This article explains the purpose and risks of Java's sun.misc.Unsafe class, categorizes its APIs, demonstrates how to obtain an Unsafe instance, and provides practical code examples for memory manipulation, CAS operations, thread control, object allocation, and building simple atomic utilities.
Unsafeatomic-operationslow-level memory
0 likes · 9 min read


21CTOJan 12, 2021 · Fundamentals
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

This article explores advanced Linux kernel hooking techniques—including kprobe, jprobe, kretprobe, and livepatch—alongside lock mechanisms and atomic operations, providing code examples and practical guidance for safe and effective kernel instrumentation.
LocksLow-Level Programmingatomic-operations
0 likes · 10 min read

This article explains the core synchronization mechanisms used in modern Linux kernels—including atomic operations, spinlocks, semaphores, and mutexes—detailing their definitions, underlying implementations, API usage, performance characteristics, and appropriate usage scenarios across different execution contexts such as process, interrupt, and soft‑interrupt contexts.
Linux kernelMutexSemaphore
0 likes · 12 min read


ITPUBSep 12, 2016 · Fundamentals
This article examines the Linux kernel’s implementation of atomic variables on ARM architectures, detailing how the LDREX and STREX instructions provide atomicity in both UP and SMP systems, analyzing source code from arch/arm/include/asm/atomic.h, and illustrating various concurrency scenarios with diagrams and step‑by‑step explanations.
ARMLDREXSTREX
0 likes · 10 min read
