Tag

atomic operations

1 views collected around this technical thread.

Deepin Linux
Deepin Linux
Mar 30, 2025 · Fundamentals

Understanding Linux Kernel Synchronization Mechanisms

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.

ConcurrencyKernelLinux
0 likes · 42 min read
Understanding Linux Kernel Synchronization Mechanisms
Java Captain
Java Captain
Feb 9, 2025 · Backend Development

Using Lua Scripts in Spring Boot with Redis for Performance and Atomic Operations

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.

LuaPerformanceRedis
0 likes · 23 min read
Using Lua Scripts in Spring Boot with Redis for Performance and Atomic Operations
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 problemCASVersioning
0 likes · 9 min read
How CAS Solves High-Concurrency Consistency Issues and the Hidden ABA Problem
Deepin Linux
Deepin Linux
Sep 26, 2024 · Fundamentals

Understanding CPU Cache Hierarchy, Write‑Back Strategy, and Memory Ordering in Multithreaded Programming

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++CPU cacheMultithreading
0 likes · 32 min read
Understanding CPU Cache Hierarchy, Write‑Back Strategy, and Memory Ordering in Multithreaded Programming
Deepin Linux
Deepin Linux
Jun 24, 2024 · Fundamentals

Understanding Linux Kernel Synchronization Mechanisms: Mutual Exclusion, Barriers, Atomic Operations, and Locks

This article explains the concepts, reasons, and implementation methods of Linux kernel synchronization, covering mutual exclusion, various lock types, compiler and memory barriers, atomic operations, semaphores, read‑write semaphores, and spinlocks with illustrative code examples and usage guidelines.

BarriersConcurrencyKernel
0 likes · 34 min read
Understanding Linux Kernel Synchronization Mechanisms: Mutual Exclusion, Barriers, Atomic Operations, and Locks
IT Services Circle
IT Services Circle
May 16, 2024 · Fundamentals

Thread Safety Explained: Private vs Shared Resources and Practical Guidelines

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.

ConcurrencyMultithreadingThread Safety
0 likes · 16 min read
Thread Safety Explained: Private vs Shared Resources and Practical Guidelines
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Dec 29, 2023 · Fundamentals

Overview of Linux Kernel Synchronization Mechanisms: Atomic Operations, Spinlocks, Semaphores, and Mutexes

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
Overview of Linux Kernel Synchronization Mechanisms: Atomic Operations, Spinlocks, Semaphores, and Mutexes
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 5, 2023 · Backend Development

Mastering Java Unsafe: Low-Level Memory Tricks and Atomic Operations

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
Mastering Java Unsafe: Low-Level Memory Tricks and Atomic Operations
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 problemCASConcurrency
0 likes · 9 min read
Understanding Compare‑And‑Swap (CAS), Its Mechanisms, and Common Pitfalls
Sohu Tech Products
Sohu Tech Products
Jun 2, 2021 · Fundamentals

Low‑Level Atomic Operations (SE‑0282) – Swift Atomics Overview

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
Low‑Level Atomic Operations (SE‑0282) – Swift Atomics Overview
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 31, 2021 · Fundamentals

Unlocking Java’s Unsafe: Access Low‑Level Memory and Concurrency Safely

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.

ConcurrencyJavaUnsafe
0 likes · 9 min read
Unlocking Java’s Unsafe: Access Low‑Level Memory and Concurrency Safely