Tagged articles
2072 articles
Page 11 of 21
Sanyou's Java Diary
Sanyou's Java Diary
Sep 5, 2022 · Fundamentals

Mastering Java Thread Safety: Levels, Strategies, and Best Practices

This article explains Java thread‑safety concepts, classifies five safety levels from immutable to thread‑hostile, and details synchronization techniques—including mutual exclusion, non‑blocking CAS, and no‑sync approaches like reentrant code and thread‑local storage—to help developers write safe concurrent code.

ImmutableSynchronizationconcurrency
0 likes · 10 min read
Mastering Java Thread Safety: Levels, Strategies, and Best Practices
FunTester
FunTester
Sep 5, 2022 · Backend Development

How Many QPS Are Needed to Reveal Thread‑Unsafe Bugs? A Hands‑On SpringBoot Test

This article explores the QPS threshold required to expose thread‑unsafe operations such as i++ by designing a SpringBoot service, running controlled load tests with both fixed‑thread and precise‑QPS models, and presenting detailed results that show how error rates increase with higher request rates.

Performance TestingQPSSpringBoot
0 likes · 8 min read
How Many QPS Are Needed to Reveal Thread‑Unsafe Bugs? A Hands‑On SpringBoot Test
Top Architect
Top Architect
Sep 3, 2022 · Backend Development

Implementing Distributed Locks with Redis, Zookeeper, and etcd

The article explains how to build reliable distributed locks using Redis, Zookeeper, and etcd, describing the essential concepts of mutual exclusion, safety, and liveness, showing code examples, highlighting common issues, and comparing each solution's advantages and drawbacks.

ZooKeeperconcurrencydistributed-lock
0 likes · 6 min read
Implementing Distributed Locks with Redis, Zookeeper, and etcd
政采云技术
政采云技术
Aug 30, 2022 · Fundamentals

Understanding Lucene Document Writing Process: Core Classes, Workflow, and Flush Strategies

This article explains the key Lucene classes involved in document indexing, outlines the end‑to‑end write workflow—including preUpdate, obtainAndLock, updateDocument, exception handling, and post‑update flush logic—and discusses the strategies and thresholds that control when in‑memory buffers are flushed to disk.

Document Writingconcurrencyindexing
0 likes · 16 min read
Understanding Lucene Document Writing Process: Core Classes, Workflow, and Flush Strategies
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Aug 29, 2022 · Mobile Development

Optimizing iOS App Startup by Adjusting GCD Queue QoS and Reducing Main Thread Preemption

By analyzing thread preemption on low‑end iPhones, this article demonstrates how selecting appropriate GCD queue QoS levels—favoring Utility or Background over User‑Initiated—reduces main‑thread contention, improves launch screen rendering by ~100 ms, and accelerates message list first‑load by up to 1.5 s without altering business logic.

GCDQoSconcurrency
0 likes · 10 min read
Optimizing iOS App Startup by Adjusting GCD Queue QoS and Reducing Main Thread Preemption
Su San Talks Tech
Su San Talks Tech
Aug 29, 2022 · Databases

Why Redis Added Multithreading in 6.0: Design Rationale and Trade‑offs

This article explains why Redis, originally designed as a single‑threaded in‑memory database, introduced a multithreaded network layer in version 6.0, covering the historical design, the limits of CPU vs I/O utilization, the role of I/O multiplexing, and the benefits and drawbacks of the new model.

I/O Multiplexingconcurrencydatabases
0 likes · 11 min read
Why Redis Added Multithreading in 6.0: Design Rationale and Trade‑offs
IT Architects Alliance
IT Architects Alliance
Aug 27, 2022 · Backend Development

Understanding ReentrantLock and the AQS Framework in Java

This article explains how Java's ReentrantLock works, detailing the role of the AbstractQueuedSynchronizer framework, the lock's internal architecture, the FIFO wait‑queue implementation, lock acquisition and release processes, and how these mechanisms avoid the herd effect in multithreaded environments.

AQSReentrantLockSynchronization
0 likes · 11 min read
Understanding ReentrantLock and the AQS Framework in Java
Top Architect
Top Architect
Aug 26, 2022 · Backend Development

Deep Dive into Java synchronized and Lock Mechanisms: Principles, JVM Internals, and Optimizations

This article explains thread safety in Java by detailing how the synchronized keyword and various Lock implementations work, covering their underlying JVM mechanisms, lock upgrade paths, optimizations like biased and lightweight locks, and practical differences between synchronized, ReentrantLock, and ReadWriteLock.

JVMLockReadWriteLock
0 likes · 19 min read
Deep Dive into Java synchronized and Lock Mechanisms: Principles, JVM Internals, and Optimizations
Tuanzi Tech Team
Tuanzi Tech Team
Aug 25, 2022 · Fundamentals

Unlocking Java’s Memory Model: CPU Caches, Cache Coherence, and Thread Safety

This article explains the hardware memory hierarchy, CPU multi‑level caches, cache coherence protocols, and how Java’s memory model abstracts these concepts to ensure thread safety, covering local and main memory, synchronization primitives, and the three core properties of atomicity, visibility, and ordering.

CPUCacheMemoryModelconcurrency
0 likes · 17 min read
Unlocking Java’s Memory Model: CPU Caches, Cache Coherence, and Thread Safety
21CTO
21CTO
Aug 24, 2022 · Fundamentals

Why Rust Is Shaping the Future of Safe System Programming

An interview with Rust creator Graydon Hoare explores the language's origins, its emphasis on speed, memory safety and concurrency, its adoption by major tech firms, and his perspective on the current state and future challenges of system programming security.

Memory SafetyRustSoftware Security
0 likes · 6 min read
Why Rust Is Shaping the Future of Safe System Programming
Xingsheng Youxuan Technology Community
Xingsheng Youxuan Technology Community
Aug 24, 2022 · Backend Development

Mastering Sliding Window Rate Limiting: Sentinel Implementation Explained

This article explains the sliding window rate‑limiting algorithm, its advantages over fixed windows, and provides a detailed step‑by‑step implementation using Sentinel’s data structures, including window partitioning, bucket management, concurrency handling, and calculation of request counts within a moving time interval.

BackendSliding Windowconcurrency
0 likes · 8 min read
Mastering Sliding Window Rate Limiting: Sentinel Implementation Explained
Top Architect
Top Architect
Aug 23, 2022 · Backend Development

Understanding the Implementation of synchronized in Java and Its Differences with Lock

This article explains how Java's synchronized keyword works at the JVM level, detailing monitorenter/monitorexit bytecode, the role of object monitors, differences between synchronized methods and blocks, and compares its behavior and performance with explicit Lock implementations such as ReentrantLock, including code examples and practical considerations.

JVMLockReentrantLock
0 likes · 8 min read
Understanding the Implementation of synchronized in Java and Its Differences with Lock
FunTester
FunTester
Aug 22, 2022 · Backend Development

How to Build a High‑Performance Log Replay Engine with Java DelayQueue

This article explains the design and implementation of a timestamp‑based log replay engine that replays HTTP traffic using Java's DelayQueue, thread pools, and custom data structures, and provides performance test results demonstrating its ability to handle hundreds of thousands of requests per second.

DelayQueuePerformance Testingconcurrency
0 likes · 10 min read
How to Build a High‑Performance Log Replay Engine with Java DelayQueue
Python Programming Learning Circle
Python Programming Learning Circle
Aug 20, 2022 · Fundamentals

Understanding Python Asyncio: Core Concepts, Event Loop Mechanics, and Performance Comparison

This article introduces Python's asyncio library, explains the fundamentals of coroutines, tasks, and the event loop, compares synchronous and asynchronous code execution with practical examples, and demonstrates how asynchronous programming can significantly improve performance in I/O‑bound scenarios.

asynchronous programmingconcurrencyevent loop
0 likes · 10 min read
Understanding Python Asyncio: Core Concepts, Event Loop Mechanics, and Performance Comparison
Dada Group Technology
Dada Group Technology
Aug 19, 2022 · Backend Development

Improving High‑Concurrency System Performance with Coroutines and the Quasar Framework

The article analyzes the high load and low CPU utilization problems of a Java service, compares various I/O models, introduces coroutine fundamentals and the Quasar library, demonstrates practical migration steps with code examples, and evaluates the performance gains and risks of adopting coroutine‑based concurrency.

BackendIO ModelQuasar
0 likes · 19 min read
Improving High‑Concurrency System Performance with Coroutines and the Quasar Framework
Su San Talks Tech
Su San Talks Tech
Aug 19, 2022 · Fundamentals

Master Java Concurrency: 60+ Interview Q&A on Threads, Locks & Thread Pools

This comprehensive guide explores Java concurrency fundamentals, covering thread creation, lifecycle, synchronization mechanisms, lock implementations, thread-local storage, memory model, atomic classes, common concurrency utilities, and detailed explanations of thread pools, their configurations, states, and best practices, accompanied by over sixty interview-style questions and code examples.

LockSynchronizationThread
0 likes · 81 min read
Master Java Concurrency: 60+ Interview Q&A on Threads, Locks & Thread Pools
Java Architect Essentials
Java Architect Essentials
Aug 18, 2022 · Backend Development

Batch Processing with Multithreading in Java: Splitting Large Collections and Using Thread Pools

This article explains how to efficiently handle massive data batch updates in Java by splitting large collections into smaller chunks, processing them concurrently with a configurable ThreadPoolExecutor, and controlling execution order, while providing reusable utility code and practical implementation examples.

ApacheCommonsBatchProcessingGuava
0 likes · 8 min read
Batch Processing with Multithreading in Java: Splitting Large Collections and Using Thread Pools
21CTO
21CTO
Aug 18, 2022 · Cloud Native

Why Go (Golang) Is the Go‑To Language for Cloud‑Native Development

This article explores Go's concise design, strong concurrency model, fast compilation, static binaries, and broad ecosystem, highlighting its ideal fit for cloud‑native applications, distributed services, and command‑line tools while also addressing its limitations and future direction.

Cloud NativeDistributed SystemsGo
0 likes · 12 min read
Why Go (Golang) Is the Go‑To Language for Cloud‑Native Development
Su San Talks Tech
Su San Talks Tech
Aug 14, 2022 · Backend Development

9 Hidden Pitfalls When Converting Synchronous Code to Multithreaded Execution

Switching from single‑threaded synchronous calls to multithreaded asynchronous execution can boost performance, but it also introduces nine common problems—including missing return values, data loss, ordering issues, thread‑safety bugs, ThreadLocal anomalies, OOM, high CPU usage, transaction failures, and service crashes—that developers must understand and mitigate.

ThreadLocalThreadPoolconcurrency
0 likes · 19 min read
9 Hidden Pitfalls When Converting Synchronous Code to Multithreaded Execution
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Aug 12, 2022 · Fundamentals

Understanding Linux rwsem: Mechanisms, Data Structures, and Optimistic Spinning

Linux rwsem is a read‑write semaphore that lets multiple readers or a single writer hold the lock, using a count field, owner pointer, optimistic‑spin queue (osq), and protected wait list; it provides fast, medium, and slow acquisition paths with handoff and optimistic spinning to reduce sleep latency compared to mutexes and spinlocks.

Linux kernelSynchronizationconcurrency
0 likes · 16 min read
Understanding Linux rwsem: Mechanisms, Data Structures, and Optimistic Spinning
Python Crawling & Data Mining
Python Crawling & Data Mining
Aug 11, 2022 · Fundamentals

Why Python Multiprocessing Needs target=func Without Parentheses

This article explains a common Python multiprocessing pitfall, showing how using target=function_name without parentheses correctly launches a new process, and illustrates the difference between passing a function object versus calling the function, accompanied by screenshots of the discussion, runtime output, and a concise solution.

Tutorialconcurrencymultiprocessing
0 likes · 3 min read
Why Python Multiprocessing Needs target=func Without Parentheses
Code Ape Tech Column
Code Ape Tech Column
Aug 4, 2022 · Backend Development

Understanding Redisson Distributed Lock Implementation

This article provides a comprehensive, step‑by‑step analysis of Redisson’s distributed lock implementation, covering its architecture, Lua scripts for lock acquisition, re‑entrancy, watchdog renewal, unlocking, fair lock mechanisms, and code examples, enabling developers to grasp and apply robust Redis‑based locking in Java applications.

Luaconcurrencydistributed-lock
0 likes · 31 min read
Understanding Redisson Distributed Lock Implementation
ITPUB
ITPUB
Jul 31, 2022 · Fundamentals

What Really Happens Inside Java’s synchronized? A Deep Dive into JVM Lock Mechanisms

This article examines the inner workings of Java’s synchronized keyword by analyzing HotSpot 1.8 source code, revealing how lightweight, heavyweight, biased, and adaptive spin locks operate, how lock inflation occurs, and how the JVM manages monitor objects, CAS operations, and thread queues to implement synchronization.

JVMMonitorconcurrency
0 likes · 17 min read
What Really Happens Inside Java’s synchronized? A Deep Dive into JVM Lock Mechanisms
Selected Java Interview Questions
Selected Java Interview Questions
Jul 29, 2022 · Backend Development

Seven Directions of Code Performance Optimization for Java Backend

This article outlines seven major areas of Java backend performance optimization—including reuse, computation, result‑set, resource‑conflict, algorithm, efficient implementation, and JVM tuning—explaining concepts, techniques, and practical examples to help developers improve application speed and resource utilization.

Backendalgorithmconcurrency
0 likes · 11 min read
Seven Directions of Code Performance Optimization for Java Backend
Top Architect
Top Architect
Jul 29, 2022 · Fundamentals

Understanding TCP Connection Limits and the Role of Port Numbers

The article explains how TCP connections are identified by a four‑tuple, why the 65535 port limit does not directly cap concurrent connections, the theoretical maximum connections for client and server roles, and how real‑world limits are governed by memory, file descriptors, and port reuse on Linux systems.

TCPconcurrencyport limits
0 likes · 11 min read
Understanding TCP Connection Limits and the Role of Port Numbers
Su San Talks Tech
Su San Talks Tech
Jul 28, 2022 · Backend Development

Asynchronous Java Programming: Threads, Futures, CompletableFuture & Spring @Async

This article introduces asynchronous programming concepts in Java, explaining how multithreading, Future, FutureTask, CompletableFuture, and Spring's @Async annotation can transform synchronous workflows into high‑throughput, low‑latency solutions, with code examples and practical guidance for implementing each technique.

CompletableFutureSpring BootThreadPool
0 likes · 17 min read
Asynchronous Java Programming: Threads, Futures, CompletableFuture & Spring @Async
FunTester
FunTester
Jul 27, 2022 · Backend Development

How Java’s DelayQueue Handles Million‑QPS Loads: Performance Test Insights

This article examines the implementation of java.util.concurrent.DelayQueue for high‑throughput performance testing, presents a custom Delayed object, shares benchmark code and results across various thread counts, and concludes that DelayQueue can sustain several million QPS when properly tuned.

DelayQueuePerformance TestingQueue
0 likes · 7 min read
How Java’s DelayQueue Handles Million‑QPS Loads: Performance Test Insights
Top Architect
Top Architect
Jul 25, 2022 · Backend Development

Using @Scheduled in Spring Boot for Task Scheduling: Configuration, Parameters, and Multi‑threading

This article explains how to create and configure Spring Boot scheduled tasks with @Scheduled, covering property‑based settings, cron expressions, fixed‑rate and fixed‑delay options, the required @EnableScheduling annotation, and how to switch from the default single‑thread executor to a multi‑threaded pool for concurrent execution.

Scheduled TasksSpring Bootconcurrency
0 likes · 9 min read
Using @Scheduled in Spring Boot for Task Scheduling: Configuration, Parameters, and Multi‑threading
Cognitive Technology Team
Cognitive Technology Team
Jul 24, 2022 · Fundamentals

Introduction to ThreadLocal in Java

ThreadLocal provides thread confinement in Java, allowing each thread to hold its own independent variable, which is useful for scenarios such as database connection isolation, transaction storage, lock-free concurrency, implicit parameter passing across functions, and highlights common pitfalls like information loss in thread pools and OOM risks.

Implicit ParametersThreadLocalconcurrency
0 likes · 5 min read
Introduction to ThreadLocal in Java
Cognitive Technology Team
Cognitive Technology Team
Jul 23, 2022 · Backend Development

Understanding FutureTask: Features, Implementation, and Common Pitfalls

FutureTask acts as a proxy for asynchronous tasks in Java, providing result retrieval with optional timeout, completion checks, cancellation, and repeat execution, while managing task state, outcomes, and exceptions; the article illustrates usage, internal fields, and common pitfalls such as missed exceptions and indefinite blocking.

AsynchronousFutureTaskThread
0 likes · 5 min read
Understanding FutureTask: Features, Implementation, and Common Pitfalls
Top Architect
Top Architect
Jul 22, 2022 · Backend Development

Understanding ExecutorCompletionService: Root Cause Analysis and Best Practices

This article analyzes a production outage caused by misuse of ExecutorCompletionService, explains the underlying Java concurrency mechanisms, compares it with ExecutorService, provides correct code examples, and offers practical guidelines to avoid memory leaks and improve backend reliability.

ExecutorCompletionServiceOOMThreadPool
0 likes · 12 min read
Understanding ExecutorCompletionService: Root Cause Analysis and Best Practices
Top Architect
Top Architect
Jul 18, 2022 · Backend Development

Understanding ThreadPoolExecutor Parameters and Working Mechanism in Java

This article explains the core concepts, configurable parameters, and execution workflow of Java's ThreadPoolExecutor, illustrating each setting with analogies, code examples, and step‑by‑step analysis to help developers design safe and efficient thread pools.

ThreadPoolThreadPoolExecutorconcurrency
0 likes · 8 min read
Understanding ThreadPoolExecutor Parameters and Working Mechanism in Java
Dada Group Technology
Dada Group Technology
Jul 16, 2022 · Backend Development

Optimizing Rider Withdrawal Payments at Dada Express: Asynchronous Concurrency, Extended Timeouts, Idempotent Retries, and Security Enhancements

This article details how Dada Express improved the efficiency of rider withdrawal payments by redesigning the clearing and disbursement workflow, introducing asynchronous thread‑pool concurrency, extending API timeouts, implementing idempotent retry logic, and adding safeguards to ensure fund security, resulting in a three‑fold reduction in processing time during peak periods.

BackendIdempotencySystem Design
0 likes · 9 min read
Optimizing Rider Withdrawal Payments at Dada Express: Asynchronous Concurrency, Extended Timeouts, Idempotent Retries, and Security Enhancements
Tencent Cloud Developer
Tencent Cloud Developer
Jul 14, 2022 · Fundamentals

Implementation Details of Scheduler and Context in libunifex (CPU Thread Execution Context)

The article explains libunifex’s CPU‑thread scheduler architecture, detailing how a lightweight scheduler wraps a manual_event_loop execution context with a mutex‑protected FIFO task queue, how operations bridge receivers to the context, and outlines various thread‑bound and platform‑specific scheduler variants.

AsyncC++Execution Context
0 likes · 16 min read
Implementation Details of Scheduler and Context in libunifex (CPU Thread Execution Context)
Sohu Tech Products
Sohu Tech Products
Jul 13, 2022 · Mobile Development

What Is a Lock? Understanding iOS Synchronization Primitives

This article explains the concept of locks in iOS, describing their purpose, the actions of acquiring and releasing, common lock types such as spin locks, mutexes, semaphores, and their implementations using OSSpinLock, pthread_mutex, NSCondition, NSLock, recursive locks, and read‑write locks, along with performance considerations and underlying principles.

LocksSynchronizationconcurrency
0 likes · 19 min read
What Is a Lock? Understanding iOS Synchronization Primitives
Cognitive Technology Team
Cognitive Technology Team
Jul 13, 2022 · Backend Development

ThreadPoolExecutor Hook Methods beforeExecute and afterExecute Must Not Throw Exceptions, Otherwise Threads Exit

The article explains that overriding ThreadPoolExecutor's beforeExecute and afterExecute hooks requires handling any exceptions internally, because uncaught exceptions cause the worker thread to terminate, reducing pool size and preventing proper reuse, and such errors are not logged by default.

Exception HandlingThreadPoolExecutorbackend-development
0 likes · 4 min read
ThreadPoolExecutor Hook Methods beforeExecute and afterExecute Must Not Throw Exceptions, Otherwise Threads Exit
FunTester
FunTester
Jul 12, 2022 · Backend Development

Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation

The article analyzes two common random‑number scenarios in software testing, identifies a CPU‑heavy custom random method, benchmarks ThreadLocalRandom, AtomicInteger, and plain int implementations under multi‑ and single‑thread loads, and proposes a lightweight AtomicInteger‑based selector that consistently delivers the best performance.

AtomicIntegerPerformance TestingRandom Number Generation
0 likes · 7 min read
Why AtomicInteger Outperforms Random() in High‑Concurrency Random Number Generation
Java High-Performance Architecture
Java High-Performance Architecture
Jul 11, 2022 · Backend Development

Preventing Coupon Over‑Issuance in High‑Concurrency Java Applications

This article examines why coupon stock can become negative under concurrent requests and presents four practical solutions—including Java synchronized blocks, SQL conditional updates, Redis distributed locks, and Redisson client usage—to reliably prevent coupon over‑issuance in high‑traffic systems.

Couponconcurrencydistributed-lock
0 likes · 11 min read
Preventing Coupon Over‑Issuance in High‑Concurrency Java Applications
Cognitive Technology Team
Cognitive Technology Team
Jul 9, 2022 · Backend Development

Avoiding OOM When Using java.util.concurrent.ExecutorCompletionService

The article explains how submitting tasks to ExecutorCompletionService without retrieving their results causes the internal unbounded LinkedBlockingQueue to retain Future objects, leading to memory leaks and OutOfMemoryError, and demonstrates the correct usage patterns to prevent this issue.

ExecutorCompletionServiceMemoryLeakOOM
0 likes · 6 min read
Avoiding OOM When Using java.util.concurrent.ExecutorCompletionService
Sanyou's Java Diary
Sanyou's Java Diary
Jul 4, 2022 · Backend Development

Mastering CompletableFuture: From Basics to RocketMQ Integration

This article introduces Java's CompletableFuture, compares it with Future, explains its core APIs, demonstrates common usage patterns—including creation, result retrieval, chaining, exception handling, and task combination—and shows a practical integration example within RocketMQ's message storage workflow.

AsyncCompletableFutureRocketMQ
0 likes · 15 min read
Mastering CompletableFuture: From Basics to RocketMQ Integration
Architect
Architect
Jul 2, 2022 · Backend Development

Asynchronous Execution Techniques in Spring Boot with CompletableFuture

The article explains multiple methods for implementing asynchronous execution in Spring Boot, covering @Async annotation, Java 8 CompletableFuture, Callable, WebAsyncTask, DeferredResult, Tomcat connection tuning, container switching to Undertow, and async interception, all illustrated with complete code examples.

AsynchronousBackendCompletableFuture
0 likes · 11 min read
Asynchronous Execution Techniques in Spring Boot with CompletableFuture
Bin's Tech Cabin
Bin's Tech Cabin
Jul 1, 2022 · Backend Development

Mastering Redis Distributed Locks: From Basics to Advanced Redlock Strategies

This comprehensive guide walks through the fundamentals, pitfalls, and advanced implementations of Redis distributed locks—including basic SETNX usage, safe lock release with Lua scripts, re‑entrant lock design, timeout handling, Redlock debates, and practical Redisson integration—providing Java developers with actionable patterns for reliable concurrency control.

LuaRedlockconcurrency
0 likes · 25 min read
Mastering Redis Distributed Locks: From Basics to Advanced Redlock Strategies
Programmer DD
Programmer DD
Jun 29, 2022 · Fundamentals

Why Real-World Analogies Reveal the 3 Core Challenges of Concurrent Programming

The article explains that concurrent programming is deeply tied to real-life scenarios and outlines its three core problems—division of work, synchronization, and mutual exclusion—using company organization, task dependencies, and traffic flow analogies, plus Java code examples to illustrate each concept.

Synchronizationconcurrencyjava
0 likes · 9 min read
Why Real-World Analogies Reveal the 3 Core Challenges of Concurrent Programming
ITPUB
ITPUB
Jun 28, 2022 · Backend Development

Mastering Distributed Locks: Database, Redis, and Zookeeper Strategies

This article explains the design and implementation of distributed locks, covering database pessimistic and optimistic locks, various Redis lock patterns, Redisson and RedLock, as well as Zookeeper's lock mechanism, and compares their advantages, drawbacks, and suitable use cases.

BackendZooKeeperconcurrency
0 likes · 20 min read
Mastering Distributed Locks: Database, Redis, and Zookeeper Strategies
FunTester
FunTester
Jun 22, 2022 · Backend Development

Implementing Go's sync.Once Behavior in Java Using ReentrantLock

This article explains the Go sync.Once primitive, demonstrates its one‑time execution with concurrent goroutines, and shows how to recreate the same functionality in Java by using a static collection and ReentrantLock to ensure a block of code runs only once across multiple threads.

ReentrantLockSingletonconcurrency
0 likes · 5 min read
Implementing Go's sync.Once Behavior in Java Using ReentrantLock
Xiao Lou's Tech Notes
Xiao Lou's Tech Notes
Jun 22, 2022 · Fundamentals

Why CPU Cache Coherence Matters: From Volatile to MESI and Memory Barriers

This article explores the fundamentals of CPU cache hierarchy, why caches are needed, how cache inconsistency arises in multicore systems, and the mechanisms—such as cache coherence protocols, MESI, store buffers, invalidate queues, and memory barriers—that ensure correct data ordering and visibility across processors.

CPUMESIcache coherence
0 likes · 21 min read
Why CPU Cache Coherence Matters: From Volatile to MESI and Memory Barriers
The Dominant Programmer
The Dominant Programmer
Jun 15, 2022 · Operations

How to Simulate 20,000 Local Requests with JMeter

This guide shows how to download, configure, and run Apache JMeter on a Windows machine to generate 20,000 HTTP requests locally by setting up a thread group, adding an HTTP sampler, and using listeners such as the Aggregate Report to analyze the load‑test results.

HTTP requestJMeterLoad Testing
0 likes · 3 min read
How to Simulate 20,000 Local Requests with JMeter
Tencent Cloud Developer
Tencent Cloud Developer
Jun 13, 2022 · Backend Development

Analysis of Go's sync.Map Implementation: Design, Architecture, and Source Code Walkthrough

The article explains how Go’s sync.Map achieves high‑concurrency performance by maintaining a lock‑free read‑only snapshot in an atomic.Value and a mutex‑protected dirty map, detailing entry state transitions, miss‑driven promotion, and the Store, Load, and Delete operations that together avoid a global lock.

GoMAPconcurrency
0 likes · 18 min read
Analysis of Go's sync.Map Implementation: Design, Architecture, and Source Code Walkthrough
21CTO
21CTO
Jun 11, 2022 · Mobile Development

Swift & SwiftUI 2022: Concurrency, Custom Layouts, and New Charts

The article reviews Apple’s WWDC 2022 announcements, highlighting Swift’s new concurrency model, actor and distributed‑actor features, SwiftUI’s custom grid layout and charting capabilities, as well as enhanced string handling and built‑in regex support for developers across iOS, iPadOS, macOS and watchOS.

AppleSwiftSwiftUI
0 likes · 5 min read
Swift & SwiftUI 2022: Concurrency, Custom Layouts, and New Charts
Java Backend Technology
Java Backend Technology
Jun 10, 2022 · Backend Development

How MemorySafeLBQ Prevents OOM in Java Thread Pools – A Deep Dive

This article explores the design and implementation of MemoryLimitedLBQ and MemorySafeLBQ, two custom LinkedBlockingQueue variants that limit memory usage to avoid Out‑Of‑Memory errors in Java thread pools, comparing their mechanisms, instrumentation dependencies, and practical usage in open‑source projects.

Instrumentationconcurrencylinkedblockingqueue
0 likes · 13 min read
How MemorySafeLBQ Prevents OOM in Java Thread Pools – A Deep Dive
Code Ape Tech Column
Code Ape Tech Column
Jun 9, 2022 · Backend Development

Introduction to Disruptor: High‑Performance Java Message Queue with Full Code Demo

This article introduces the open‑source Disruptor library, explains its core concepts such as Ring Buffer, Sequencer, and Wait Strategy, and provides a step‑by‑step Java implementation—including Maven dependency, event model, factory, handler, manager, producer, and test code—demonstrating how to build a fast in‑memory message queue.

DisruptorMessage QueueRing Buffer
0 likes · 10 min read
Introduction to Disruptor: High‑Performance Java Message Queue with Full Code Demo
Tencent Cloud Developer
Tencent Cloud Developer
Jun 8, 2022 · Backend Development

Understanding Go Map and Slice Concurrency Safety and Parameter Passing

The article explains that Go maps and slices are not safe for concurrent reads or writes, describes how the runtime detects map violations, and recommends using sync.Mutex, sync.RWMutex, or sync.Map for maps and external synchronization for slices, while also clarifying that passing these reference types to functions shares underlying data unless explicitly copied.

GoMAPParameter Passing
0 likes · 12 min read
Understanding Go Map and Slice Concurrency Safety and Parameter Passing
JavaEdge
JavaEdge
Jun 2, 2022 · Backend Development

How Does Java’s synchronized Work? A Deep Dive into Lock Mechanisms

This article simulates a Baidu interview to explain the underlying implementation of Java’s synchronized keyword, covering monitorenter/monitorexit bytecode, object header Mark Word, lock states, lock escalation from biased to heavyweight, and the role of CAS in lock acquisition and release.

JVMLockSynchronization
0 likes · 10 min read
How Does Java’s synchronized Work? A Deep Dive into Lock Mechanisms
Tencent Cloud Developer
Tencent Cloud Developer
Jun 2, 2022 · Fundamentals

A Detailed Explanation of Asynchronous Programming

The article explains asynchronous programming by contrasting concurrency, parallelism, and synchronization, illustrates how splitting serial work into independent async tasks can improve performance but introduces resource, locking, and state‑tracking challenges, and offers strategies such as careful task limits, locking, queues, and result monitoring.

ParallelismProgramming Conceptsasynchronous programming
0 likes · 23 min read
A Detailed Explanation of Asynchronous Programming
IT Services Circle
IT Services Circle
Jun 2, 2022 · Fundamentals

Comprehensive Guide to Java Concurrency: Threads, Locks, Executors, and Synchronization Primitives

This article provides an in-depth overview of Java concurrency, covering thread creation, lifecycle, synchronization mechanisms such as locks, semaphores, barriers, atomic classes, concurrent collections, executor frameworks, fork/join, CompletableFuture, and various blocking queues, with code examples and implementation details.

BlockingQueueExecutorServiceLocks
0 likes · 52 min read
Comprehensive Guide to Java Concurrency: Threads, Locks, Executors, and Synchronization Primitives
Code Ape Tech Column
Code Ape Tech Column
Jun 2, 2022 · Backend Development

Using Alibaba's TransmittableThreadLocal to Propagate ThreadLocal Variables in Thread Pools

This article explains why InheritableThreadLocal fails in pooled threads, introduces Alibaba's TransmittableThreadLocal library, demonstrates how to wrap executors and rewrite code to correctly transmit ThreadLocal data across parent‑child threads in Java thread pools, and provides detailed implementation and usage examples.

ThreadLocalThreadPoolTransmittableThreadLocal
0 likes · 13 min read
Using Alibaba's TransmittableThreadLocal to Propagate ThreadLocal Variables in Thread Pools
FunTester
FunTester
Jun 2, 2022 · Backend Development

How Fast Can Apache Commons Pool2 Run? A Deep Performance Test

This article details a performance evaluation of Apache Commons Pool2 on a MacBook Pro, comparing no‑wait and wait scenarios, presenting QPS results, identifying bottlenecks in LinkedBlockingDeque and AtomicLong, and outlining the test setup, code, and conclusions.

Apache Commons PoolGroovyObject Pooling
0 likes · 5 min read
How Fast Can Apache Commons Pool2 Run? A Deep Performance Test
Code Ape Tech Column
Code Ape Tech Column
Jun 1, 2022 · Fundamentals

Understanding sun.misc.Unsafe: Construction, Core Functions, and Practical Use Cases

This article explains the purpose, construction, and key functionalities of Java's sun.misc.Unsafe class, covering memory management, object allocation, class definition, offset handling, array operations, thread scheduling, CAS, and memory fences, while also showing how to obtain an Unsafe instance via reflection.

Memory ManagementReflectionconcurrency
0 likes · 11 min read
Understanding sun.misc.Unsafe: Construction, Core Functions, and Practical Use Cases
dbaplus Community
dbaplus Community
May 25, 2022 · Backend Development

How to Ensure Concurrency Quality with Distributed Locks in E‑Commerce Systems

This article explains why concurrency issues like overselling occur in e‑commerce, introduces distributed lock concepts and mainstream implementations (MySQL, Redis, Zookeeper/etcd), and provides a three‑stage quality‑assurance framework with code‑review checklists, testing methods, and data‑reconciliation techniques.

BackendCode reviewconcurrency
0 likes · 12 min read
How to Ensure Concurrency Quality with Distributed Locks in E‑Commerce Systems
DaTaobao Tech
DaTaobao Tech
May 25, 2022 · Backend Development

Best Practices for Java Thread Pools and ThreadLocal in Backend Development

The article outlines Java thread‑pool fundamentals, explains ThreadPoolExecutor parameters and Tomcat’s custom pool behavior, and provides best‑practice guidelines for creating pools directly, configuring rejection policies, and safely using ThreadLocal—including static declarations, proper cleanup, and avoiding memory‑leak pitfalls—to build stable, high‑performance backend services.

BackendThreadLocalThreadPool
0 likes · 32 min read
Best Practices for Java Thread Pools and ThreadLocal in Backend Development
Code Ape Tech Column
Code Ape Tech Column
May 24, 2022 · Databases

Understanding MVCC (Multi-Version Concurrency Control) in MySQL InnoDB

This article provides a comprehensive, step‑by‑step explanation of MySQL InnoDB's MVCC mechanism, covering its fundamentals, the role of Undo Log and Read View, and how it enables repeatable‑read and read‑committed isolation levels while preventing dirty reads and other concurrency anomalies.

MVCCconcurrencydatabase
0 likes · 12 min read
Understanding MVCC (Multi-Version Concurrency Control) in MySQL InnoDB
FunTester
FunTester
May 23, 2022 · Backend Development

Using Apache Commons Pool2 GenericKeyedObjectPool for gRPC Connection Management

This article explains how to apply Apache Commons Pool2's GenericKeyedObjectPool to pool gRPC ManagedChannel objects, discusses thread‑safety and performance considerations, and provides concrete Java code for a keyed object pool factory, pool configuration, and typical acquire/return usage patterns.

Apache Commons Pool2Object Poolingconcurrency
0 likes · 7 min read
Using Apache Commons Pool2 GenericKeyedObjectPool for gRPC Connection Management
Cognitive Technology Team
Cognitive Technology Team
May 22, 2022 · Fundamentals

Lock‑Free (Non‑Blocking) Algorithms and Their Implementation in Java

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.

ABACASatomic
0 likes · 5 min read
Lock‑Free (Non‑Blocking) Algorithms and Their Implementation in Java
Cognitive Technology Team
Cognitive Technology Team
May 21, 2022 · Fundamentals

Cooperative Thread Cancellation in Java: Flags and Interrupts

The article explains that Java lacks a safe preemptive way to stop threads and describes two cooperative cancellation mechanisms—using a volatile cancellation flag and using thread interruption—along with code examples and practical considerations for each approach.

Threadcancellationconcurrency
0 likes · 5 min read
Cooperative Thread Cancellation in Java: Flags and Interrupts
Code Ape Tech Column
Code Ape Tech Column
May 19, 2022 · Backend Development

Understanding Java CompletionService: Implementation, Usage, and Performance Benefits

This article explains the purpose and implementation of Java's CompletionService, compares it with ExecutorService, shows how it retrieves task results in completion order, provides detailed source code analysis, and discusses typical use cases such as load‑balancing and fast‑result retrieval in concurrent applications.

CompletionServiceExecutorServiceThreadPool
0 likes · 11 min read
Understanding Java CompletionService: Implementation, Usage, and Performance Benefits
Sohu Tech Products
Sohu Tech Products
May 18, 2022 · Fundamentals

Understanding Strong vs. Weak Consistency in Java's ConcurrentHashMap

This article explains the concepts of strong and weak consistency, their roots in visibility and ordering within the Java Memory Model, and how Java 8’s ConcurrentHashMap uses volatile fields, CAS, and unsafe operations to achieve strong consistency for put/get while retaining weak consistency for operations like size().

ConcurrentHashMapConsistencyMemory Model
0 likes · 14 min read
Understanding Strong vs. Weak Consistency in Java's ConcurrentHashMap
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 problemCASatomic operations
0 likes · 9 min read
Understanding Compare‑And‑Swap (CAS), Its Mechanisms, and Common Pitfalls
Tencent Cloud Developer
Tencent Cloud Developer
May 16, 2022 · Fundamentals

Lock‑Free Queues: Use Cases, Implementations, and Performance Analysis

The article explains when lock‑free queues are needed, why they outperform locked alternatives, presents single‑producer and multi‑producer implementations with detailed code, benchmarks their throughput versus mutex‑based queues, and concludes they excel for low‑contention or dominant‑producer scenarios but may lag under high contention.

C++concurrencylock-free queue
0 likes · 33 min read
Lock‑Free Queues: Use Cases, Implementations, and Performance Analysis
Cognitive Technology Team
Cognitive Technology Team
May 14, 2022 · Backend Development

Copy‑On‑Write Strategy and Its Implementation in Java's CopyOnWriteArrayList

The article explains the copy‑on‑write (COW) concurrency strategy, its suitability for read‑heavy scenarios, and demonstrates how Java implements COW with CopyOnWriteArrayList and CopyOnWriteArraySet, including volatile array handling, write‑locking, snapshot reads, and iterator behavior.

Copy-on-WriteCopyOnWriteArrayListData Structures
0 likes · 7 min read
Copy‑On‑Write Strategy and Its Implementation in Java's CopyOnWriteArrayList
Su San Talks Tech
Su San Talks Tech
May 14, 2022 · Backend Development

Unlocking ThreadLocal: How Java Manages Thread‑Local Data and Avoids Memory Leaks

This article explains why ThreadLocal is used in Java concurrency, dives into its internal implementation—including ThreadLocalMap, weak‑referenced keys, hash‑based indexing and resizing—covers common pitfalls such as memory leaks, and shows how InheritableThreadLocal and TransmittableThreadLocal can safely share data across child threads and thread pools.

InheritableThreadLocalMemoryLeakThreadLocal
0 likes · 24 min read
Unlocking ThreadLocal: How Java Manages Thread‑Local Data and Avoids Memory Leaks
High Availability Architecture
High Availability Architecture
May 13, 2022 · Backend Development

Error Handling and Errgroup Usage in Go

This article explains Go's built-in error interface, distinguishes errors from exceptions, compares three common error-handling patterns, discusses wrapping errors with packages like pkg/errors, and demonstrates centralized error handling using errgroup, including usage examples and best-practice recommendations for backend Go development.

BackendError HandlingGo
0 likes · 17 min read
Error Handling and Errgroup Usage in Go
Meituan Technology Team
Meituan Technology Team
May 12, 2022 · Backend Development

CompletableFuture: Principles, Usage, and Practical Implementation in Java

The article explains how Java 8’s CompletableFuture enables efficient asynchronous programming—illustrated by Meituan’s order service refactor—by replacing slow synchronous RPC calls with composable, lazy, back‑pressure‑aware futures, offering thread‑pool best practices, robust exception handling, utility helpers, and achieving up to a 45 % latency reduction and fewer servers.

AsynchronousCompletableFutureThreadPool
0 likes · 29 min read
CompletableFuture: Principles, Usage, and Practical Implementation in Java