Tagged articles
lock-free
57 articles · Page 1 of 1
Xiaohongshu open-sources RED OHC, a Java off-heap cache achieving 3.38x throughput over Cassandra OHC in 32-thread reads via lock-free reads, epoch-based reclamation, background actor for eviction and memory return, and cache-line-aligned data structures, with benchmarks showing near-zero heap allocation and GC.
Cassandra OHCJavaS3-FIFO
0 likes · 25 min read

The article surveys ten practical performance‑optimization tactics—from classic indexing, compression, and caching to prefetching, peak‑shaving, batch processing, and advanced methods such as resource squeezing, horizontal scaling, sharding, and lock‑free designs—explaining their trade‑offs, concrete examples, and when to apply each in real‑world systems.
CachingCompressionHorizontal Scaling
0 likes · 36 min read

This article demystifies Java's Compare‑And‑Swap (CAS) instruction, shows how atomic classes like AtomicInteger achieve lock‑free increments, discusses CAS's three main drawbacks, surveys the entire java.util.concurrent.atomic family, and explains how LongAdder improves high‑contention counting.
Atomic ClassesCASConcurrency
0 likes · 15 min read

When a service’s QPS jumps from two to eight million, a single global lock can turn a multi‑core machine into a bottleneck, so the article walks through coarse‑lock problems, fine‑grained locking, read‑write separation, optimistic reads, CAS‑based lock‑free techniques, LongAdder and advanced data structures, showing when each step is appropriate for high‑throughput systems.
CASJavaLocks
0 likes · 19 min read

This article analyzes nine lock-free data structures in Android 17, including MPSC/SPSC queues, triple buffers, ring buffers, and a lock-free MessageQueue, detailing their mechanisms, memory layouts, and use cases in audio, graphics, Binder IPC, and Perfetto tracing.
AndroidAudioFlingerMPSC
0 likes · 7 min read

Android 17 enhances Binder observability with a lock-free SPSC queue, boot-stable sharding, exponential latency histograms, and CPU sampling in the user-space Observer V2, while introducing a kernel Netlink channel for asynchronous, zero-overhead IPC error events like frozen transactions and spam detection.
Android 17BinderIPC
0 likes · 8 min read

This article explains what interviewers expect when they ask about implementing a low‑latency C++ trading system, covering hardware‑level concepts such as cache hierarchy, false sharing, NUMA, kernel bypass, CPU pinning, lock‑free programming, memory‑order semantics, and modern C++ techniques that together achieve microsecond‑ or nanosecond‑scale determinism.
C++NUMAhigh-frequency trading
0 likes · 34 min read

The article explains the Linux kernel Seqlock mechanism—a lightweight lock‑free synchronization primitive that uses a sequence number and a spinlock to allow concurrent reads and writes, compares it with spinlocks and rwlocks, and shows real kernel and user‑space examples.
ConcurrencyLinux kernelSeqlock
0 likes · 24 min read

LoongCollector, the open‑source cloud‑native collector behind Alibaba Cloud's Simple Log Service, achieves ten‑fold higher throughput, up to 80% lower CPU and memory usage, near‑linear scaling, zero‑copy processing, lock‑free event pools and adaptive concurrency, while guaranteeing enterprise‑grade reliability for petabyte‑scale log and metric ingestion.
adaptive-concurrencycloud-nativehigh-throughput
0 likes · 16 min read

The article analyzes three Redis inventory‑deduction locking strategies—exclusive lock, segmented lock, and lock‑free/key‑quantization—detailing their key structures, suitable scenarios, advantages, drawbacks, and also covers Lua‑script atomic decrement, async queue buffering, and local pre‑deduction techniques.
Exclusive LockInventoryLua
0 likes · 8 min read

This article dives deep into Go’s sync/atomic package, explaining its low‑level CPU implementation, performance advantages over mutexes, core operation families, practical examples like CAS‑based spin locks and atomic.Value hot‑reloading, and provides guidance on when to choose atomic primitives.
CASGolock-free
0 likes · 9 min read

Lock‑free queues replace costly mutexes with atomic operations, eliminating lock contention, deadlocks, and scalability limits, and this article explains their principles, classic implementations, C++ code examples, performance testing, and real‑world applications such as game engines and high‑throughput servers.
C++CASConcurrency
0 likes · 38 min read

This article explains the challenges of multithreaded programming, compares blocking, lock‑free and wait‑free approaches, details essential atomic primitives, and provides a practical Java lock‑free stack implementation with best‑practice guidelines.
Javaatomic-primitiveslock-free
0 likes · 16 min read

The article outlines seven practical performance‑optimization techniques for high‑throughput back‑ends—including replacing protobuf with native C++ classes, adopting cache‑friendly data structures, using jemalloc/tcmalloc, implementing lock‑free double buffers, simplifying structs for specific scenarios, and leveraging profiling tools—while stressing balanced, incremental improvements.
C++Cache FriendlyProtobuf
0 likes · 16 min read

This guide explains how to build high‑performance lock‑free data structures in Rust by using atomic operations, memory ordering semantics, and practical examples such as a thread‑safe counter and a lock‑free stack, followed by best‑practice recommendations.
Concurrencyatomiclock-free
0 likes · 4 min read

This article explains how to design and implement a high‑performance custom network protocol in Rust, covering zero‑copy parsing, memory‑mapped packet pools, lock‑free event loops, and an efficient binary packet format to achieve ultra‑low latency and massive concurrency.
Rusthigh-performancelock-free
0 likes · 9 min read

This article dissects Go's runtime GPM model and the lock‑free runq data structure, detailing its fields, core operations such as runqput, runqget, runqgrab, and their atomic implementations, while also comparing local and global queues and illustrating the code paths with concrete examples.
ConcurrencyGoRuntime
0 likes · 24 min read

This article examines Go’s internal lock‑free single‑producer multi‑consumer queues—PoolDequeue and its dynamic extension PoolChain—detailing their design, atomic operations, and benchmark comparisons that show they can be up to ten times faster than standard channels in a producer‑consumer workload.
ConcurrencyGoQueue
0 likes · 13 min read

This article outlines nine practical methods—caching, parallelization, batch processing, data compression, lock‑free design, sharding, request avoidance, pooling, and asynchronous handling—demonstrating how each can be applied to backend services to dramatically reduce latency and improve throughput.
CachingCompressionParallelism
0 likes · 25 min read

The article explains the Disruptor—an intra‑process, lock‑free, array‑based queue that achieves millions of operations per second—by covering its core concepts, demo code, source‑code mechanics, performance optimizations such as pre‑allocation and false‑sharing avoidance, and real‑world Vivo iTheme applications with best‑practice tips.
DisruptorJavaProducer-Consumer
0 likes · 29 min read

This article provides a comprehensive guide to Java atomic variables, explaining their core concepts, underlying CAS mechanism, key classes such as AtomicInteger, AtomicLong, AtomicReference, and AtomicBoolean, and demonstrating practical code examples, use‑cases, performance benefits, limitations, and comparisons with traditional lock‑based synchronization.
Atomic VariablesCASConcurrency
0 likes · 21 min read

Disruptor is an open‑source, lock‑free Java framework that uses a ring‑buffer and sequencer to achieve ultra‑high‑throughput, handling millions of events per second, and is employed by projects like LMAX, Storm, Camel, and Log4j2, with detailed concepts, wait strategies, and usage examples.
ConcurrencyDisruptorJava
0 likes · 13 min read

The article presents practical backend performance optimization methods—including substituting Protobuf with native C++ classes, employing cache‑friendly data structures, integrating jemalloc/tcmalloc, using lock‑free double‑buffer designs, and tailoring data formats—to achieve up to three‑fold speed improvements and significant latency reductions.
C++Cache FriendlyProtobuf
0 likes · 15 min read

This article explores the fundamentals of multithreaded programming, comparing traditional lock-based synchronization with advanced lock-free techniques, and demonstrates how iLogtail implements thread models, memory barriers, atomic operations, spin locks, double-buffering, and deferred reclamation to achieve scalable, high-performance concurrency.
C++MultithreadingiLogtail
0 likes · 25 min read

This article walks through a series‑by‑step performance‑tuning process for high‑throughput C++ services, replacing Protobuf with plain classes, adopting cache‑friendly hash tables, switching to jemalloc, implementing a double‑buffer lock‑free data structure, and tailoring data formats, each backed by concrete code examples, benchmark results, and analysis of trade‑offs.
C++Cache FriendlyProtobuf
0 likes · 20 min read

This article presents practical performance‑optimization strategies for high‑throughput C++ services, including replacing Protobuf with hand‑written classes, adopting cache‑friendly data structures, using jemalloc/tcmalloc instead of the default allocator, employing lock‑free double‑buffer designs, tailoring data formats for specific workloads, and leveraging profiling tools to measure gains.
C++Cache FriendlyProtobuf
0 likes · 17 min read

The article outlines practical, continuous performance‑optimization tactics for high‑throughput back‑end services—replacing Protobuf with lightweight C++ classes, using cache‑friendly data structures, adopting jemalloc/tcmalloc, employing lock‑free double buffers, tailoring data formats, and leveraging profiling tools—to achieve multi‑fold speedups while balancing maintainability.
BackendC++Cache Friendly
0 likes · 18 min read

This article explains how Java achieves lock‑free concurrency using CAS and volatile for optimistic locking, discusses its advantages and drawbacks such as the ABA problem and contention hotspots, and presents solutions including versioned CAS classes and contention‑reduction techniques provided by the JUC package.
CASConcurrencyJUC
0 likes · 6 min read

This article explains the design and evolution of Baidu Cloud File System's (CFS) metadata service, detailing how a novel lock‑free architecture and strategic data layout enable POSIX‑compatible, highly scalable storage that can handle billions of files while maintaining high performance and consistency.
cloud storagedistributed file systemlock-free
0 likes · 42 min read


ITPUBFeb 18, 2023 · Backend Development
This comprehensive guide explores essential backend techniques—including lock‑free programming, zero‑copy I/O, efficient serialization, pooling, concurrency, async processing, caching strategies, sharding, storage optimizations, and queue mechanisms—to build high‑performance, scalable services while highlighting practical code examples and real‑world trade‑offs.
BackendCachingQueue
0 likes · 51 min read

This article introduces Java's Disruptor framework as a high-performance, lock-free queue, explains its core components such as RingBuffer, Sequencer, and WaitStrategy, provides sample code for producers and consumers, and discusses how it avoids lock contention and false sharing.
ConcurrencyDisruptorJava
0 likes · 12 min read

This article introduces various Java queue implementations, explains the Disruptor framework’s architecture, demonstrates its usage with complete code examples, and analyzes core components such as RingBuffer, Sequencer, and WaitStrategy while addressing performance issues like false sharing and multi‑producer coordination.
DisruptorJavaconcurrent queue
0 likes · 12 min read

This article explains how HikariCP's lock‑free ConcurrentBag manages database connections using ThreadLocal caches, a CopyOnWriteArrayList, AtomicInteger waiters, and a SynchronousQueue, and walks through the key code for borrowing and returning connections to improve Java multithreaded performance.
ConcurrencyConcurrentBagHikariCP
0 likes · 11 min read

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 problemCASUnsafe
0 likes · 15 min read

Lock‑free (non‑blocking) algorithms replace traditional locks with hardware primitives such as compare‑and‑swap (CAS) to ensure data consistency during concurrent access, offering superior scalability and eliminating deadlocks, and the article explains Java’s atomic variables, CAS‑based implementations, and how to address the ABA problem with AtomicStampedReference.
ABACASConcurrency
0 likes · 5 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

This article, the second in a Go high‑performance series, details concurrency optimizations including lock‑free data structures versus locked lists, sharding and RWMutex to cut lock contention, controlling goroutine creation with pooling, using sync.Once for cheap one‑time initialization, and employing sync.Cond for efficient goroutine notification.
ConcurrencyGoRWMutex
0 likes · 30 min read

The article reviews Baidu C++ engineers' concurrency optimizations, explaining why modern software must exploit parallelism and detailing SIMD vectorization, out‑of‑order execution, and micro‑architectural analysis, then compares mutex, lock‑free, and wait‑free synchronization, showcasing case studies where atomic and wait‑free designs dramatically improve multithreaded performance.
ConcurrencyMultithreadingSIMD
0 likes · 35 min read

This article dissects Java 7 and Java 8 ConcurrentHashMap internals, explaining how segments, volatile fields, CAS, lock‑free reads, the put method, resizing, and size calculation work together to provide thread‑safe high‑throughput map operations.
ConcurrencyConcurrentHashMapJava
0 likes · 24 min read

The article explains how Java 8's ConcurrentHashMap implements a lock‑free get() operation by replacing the Segment design with Node objects, using volatile fields and CAS, and how the volatile‑marked table array ensures visibility during resizing, making reads both safe and efficient.
ConcurrencyConcurrentHashMapJava
0 likes · 10 min read

This article explains how Java 8's ConcurrentHashMap implements the get operation without acquiring locks by using volatile fields, CAS, and a simplified node structure, contrasting it with the segment‑based design of JDK 1.7 and detailing the memory‑visibility guarantees provided by volatile.
ConcurrencyConcurrentHashMapJDK8
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


JavaEdgeOct 8, 2020 · Backend Development
This article explains how the Disruptor library attains true lock‑free performance through single‑threaded writes, the use of memory barriers (volatile and happens‑before semantics), cache‑line alignment to eliminate false sharing, and a sequence‑barrier algorithm, providing code examples and practical optimization tips.
DisruptorJava Concurrencyfalse sharing
0 likes · 5 min read

This article explains how Java's AtomicInteger and related atomic classes provide lock‑free thread‑safe operations to replace non‑atomic constructs like i++, detailing their inheritance, underlying Unsafe mechanisms, CAS implementation, memory barriers, optimistic locking, the ABA problem, and practical code examples for increment, decrement, and custom CAS‑based locks.
CASConcurrencyJava
0 likes · 15 min read

Because PHP lacks native multithreading, Swoole adopts a multi‑process model and provides the Atomic class for lock‑free integer operations, which can be shared across worker processes; this guide explains its purpose, configuration, usage patterns, code examples, and important pitfalls.
BackendConcurrencyPHP
0 likes · 3 min read

This article explains why Java 8's ConcurrentHashMap.get() operation is lock‑free, describing the underlying data‑structure changes from JDK 1.7 to 1.8, the role of volatile‑marked Node fields and array, and how visibility and cache‑coherence guarantee thread‑safe reads.
ConcurrentHashMapJDK8Java
0 likes · 10 min read

The article introduces HotRing, a hotspot‑aware in‑memory key‑value store from Alibaba's Tair team, explains the extreme traffic challenges of Alibaba's Double‑11 peak, details the design of ordered‑ring hashing, dynamic hotspot detection, lock‑free concurrency and rehashing, and shows how these innovations achieve up to 2.58× higher throughput than existing KV systems.
Database PerformanceHotRingRCU
0 likes · 16 min read

This article explains why traditional locking harms Java performance‑testing throughput, introduces lock‑free alternatives such as CAS and ThreadLocal, and provides a complete Java demo that shows how each thread can hold its own object to eliminate contention and boost speed.
ConcurrencyJavaThreadLocal
0 likes · 5 min read

This article explains the Compare‑And‑Swap (CAS) primitive, its three operands, how Java's Unsafe class implements CAS methods, the internal workings of AtomicInteger, common pitfalls like spinning, single‑variable limits and the ABA problem, and the enhancements introduced in Java 8.
CASConcurrencyJDK8
0 likes · 9 min read

This article explains the thread‑safe ConcurrentLinkedQueue in Java, covering its lock‑free linked‑list structure, core methods such as add, offer, and poll, detailed source‑code analysis, and a multithreaded example demonstrating its behavior in high‑concurrency scenarios.
ConcurrencyConcurrentLinkedQueueJava
0 likes · 12 min read

LinkedTransferQueue, introduced in JDK 7, combines the capacity of traditional BlockingQueues with the lock‑free behavior of SynchronousQueue, using a sophisticated node‑based algorithm that matches producers and consumers without locking the whole queue, offering high‑performance concurrent data transfer.
BlockingQueueConcurrencyJava
0 likes · 16 min read

This article explains the lock‑free design of Java's ConcurrentLinkedQueue, detailing its core invariants, the internal Node structure, and step‑by‑step analyses of the offer and poll methods with code snippets and visual illustrations to demystify its CAS‑based concurrency mechanisms.
CASConcurrentLinkedQueueJava
0 likes · 13 min read

This article analyses the performance challenges of high‑concurrency Java applications, explains how misuse of atomic operations and blocking degrade throughput, introduces an asynchronous monitor concept and a concrete AsyncMutex implementation, and presents experimental results showing its scalability advantages over traditional ReentrantLock‑based locking.
ConcurrencyJavaasync mutex
0 likes · 15 min read

This article explains how lock-free techniques such as Compare-And-Swap (CAS) and Java's atomic classes—including AtomicBoolean, AtomicInteger, AtomicReference, and their array and field updaters—provide optimistic concurrency control, reduce context switches, and improve performance compared to traditional locking mechanisms.
CASConcurrencyJava
0 likes · 11 min read

The Disruptor library provides a lock‑free, CAS‑driven ring‑buffer queue that eliminates lock contention and false sharing, delivering 4–7× higher throughput and nanosecond‑level latency compared to Java’s built‑in queues, and is employed by systems such as Log4j 2, Apache Storm, and Meituan‑Dianping.
ConcurrencyDisruptorJava
0 likes · 21 min read

The article analyzes write‑mostly, read‑light cache scenarios such as driver location updates and counter increments, discusses lock bottlenecks, proposes horizontal sharding and per‑record locking, explores lock‑free approaches with data‑integrity signatures, and summarizes practical optimization techniques for high‑concurrency back‑end systems.
CacheConcurrencySharding
0 likes · 8 min read

The article analyzes the challenges of scaling network devices to handle ten‑million concurrent connections (C10M) and describes Alibaba's AGW solution, which uses lock‑free data planes, hugepages, NUMA‑aware memory placement, and user‑space NIC drivers to achieve high‑performance four‑layer load balancing.
C10MNUMAhugepage
0 likes · 9 min read
