Xuanwu Backend Tech Stack
Author

Xuanwu Backend Tech Stack

Primarily covers fundamental Java concepts, mainstream frameworks, deep dives into underlying principles, and JVM internals.

80
Articles
0
Likes
156
Views
0
Comments
Recent Articles

Latest from Xuanwu Backend Tech Stack

80 recent articles
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Feb 4, 2025 · Backend Development

When to Use Class.forName vs. ClassLoader in Java? A Deep Dive

This article explains Java's reflection mechanisms, comparing Class.forName and ClassLoader as two primary ways to load classes, detailing their behavior, static initialization effects, code examples, and practical scenarios such as loading JDBC drivers versus custom dynamic loading.

Class.forNameDynamic LoadingJDBC driver
0 likes · 6 min read
When to Use Class.forName vs. ClassLoader in Java? A Deep Dive
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
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 18, 2025 · Backend Development

How Java’s String.intern() Boosts Memory Efficiency and Performance

Java’s String.intern() method adds a string to the constant pool, enabling memory sharing and faster reference comparisons; this article explains its behavior, demonstrates usage with code examples, and discusses performance benefits and cautions for optimal use in real‑world applications.

Javainternmemory optimization
0 likes · 5 min read
How Java’s String.intern() Boosts Memory Efficiency and Performance
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 17, 2025 · Backend Development

Why Reentrant Locks Prevent Deadlocks and How to Use Them in Java

Reentrant locks are thread‑safe synchronization tools that let the same thread acquire the same lock multiple times without deadlocking, tracking acquisition counts, and offering advantages over traditional synchronized blocks, with Java’s ReentrantLock providing flexible features such as interruptible and timed locking, illustrated by a complete code example.

JavaReentrantLockThread Safety
0 likes · 6 min read
Why Reentrant Locks Prevent Deadlocks and How to Use Them in Java
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 14, 2025 · Backend Development

Mastering Java ThreadLocal: Core Operations, Map Structure, and Practical Examples

This article explains Java's ThreadLocal mechanism, detailing its internal ThreadLocalMap structure, core set/get/remove operations with full code examples, and demonstrates how multiple ThreadLocal variables are stored per thread, providing a clear understanding of thread‑local storage in backend development.

JavaThreadLocalThreadLocalMap
0 likes · 6 min read
Mastering Java ThreadLocal: Core Operations, Map Structure, and Practical Examples