Tag

InheritableThreadLocal

0 views collected around this technical thread.

JD Tech Talk
JD Tech Talk
Mar 31, 2025 · Backend Development

InheritableThreadLocal and Thread Pool Interaction Leading to Null Pointer Exception

This article analyzes a null pointer exception caused by InheritableThreadLocal and thread pool reuse, explaining how shared threads in a pool can lead to data corruption when parent thread values are not properly managed.

BackendDevelopmentConcurrencyInheritableThreadLocal
0 likes · 13 min read
InheritableThreadLocal and Thread Pool Interaction Leading to Null Pointer Exception
Selected Java Interview Questions
Selected Java Interview Questions
Feb 16, 2025 · Backend Development

Understanding ThreadLocal Implementation and Memory Leak Issues in Java

This article explains how ThreadLocal stores values per thread, details the internal set and get mechanisms, discusses potential memory‑leak problems caused by stale entries, and provides best‑practice guidelines such as using remove() and InheritableThreadLocal for child threads.

ConcurrencyInheritableThreadLocalJava
0 likes · 9 min read
Understanding ThreadLocal Implementation and Memory Leak Issues in Java
IT Services Circle
IT Services Circle
Jan 15, 2023 · Backend Development

Understanding ThreadLocal and InheritableThreadLocal: Causes and Solutions for Missing Client Information in Multithreaded Java Services

This article explains why client information stored in ThreadLocal becomes unavailable after switching a single‑threaded search service to multithreading, analyzes the underlying ThreadLocal and InheritableThreadLocal mechanisms, and provides two practical solutions—passing the context manually or using InheritableThreadLocal—to avoid the upgrade‑prompt bug.

ConcurrencyInheritableThreadLocalJava
0 likes · 13 min read
Understanding ThreadLocal and InheritableThreadLocal: Causes and Solutions for Missing Client Information in Multithreaded Java Services
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 28, 2022 · Fundamentals

Understanding ThreadLocal in Java: Creation, Usage, and Implementation Details

This article explains Java's ThreadLocal class, covering its purpose for thread‑local storage, core methods such as get, set, and remove, ways to set initial values via subclassing or withInitial, usage of InheritableThreadLocal for parent‑child thread data propagation, and the underlying implementation details.

ConcurrencyInheritableThreadLocalJava
0 likes · 12 min read
Understanding ThreadLocal in Java: Creation, Usage, and Implementation Details
Selected Java Interview Questions
Selected Java Interview Questions
May 5, 2022 · Backend Development

Understanding ThreadLocal in Java: Principles, Memory Leak Issues, and Proper Usage

This article explains Java's ThreadLocal mechanism, detailing its internal structure, including key methods like set, get, and remove, demonstrates how improper use can cause memory leaks, and provides best practices and examples for safe usage, including InheritableThreadLocal and real-world scenarios.

Best PracticesConcurrencyInheritableThreadLocal
0 likes · 18 min read
Understanding ThreadLocal in Java: Principles, Memory Leak Issues, and Proper Usage
Selected Java Interview Questions
Selected Java Interview Questions
Apr 4, 2022 · Backend Development

Using InheritableThreadLocal to Access Parent ThreadLocal Values in Child Threads (Java)

This article explains how to make a child thread inherit the values stored in a parent thread's ThreadLocal by using InheritableThreadLocal, demonstrates the behavior with a runnable Java example, and details the underlying ThreadLocalMap mechanism that enables the inheritance.

Backend DevelopmentConcurrencyInheritableThreadLocal
0 likes · 3 min read
Using InheritableThreadLocal to Access Parent ThreadLocal Values in Child Threads (Java)
vivo Internet Technology
vivo Internet Technology
Jan 27, 2021 · Backend Development

TransmittableThreadLocal Practice: Solving Multi-Country Business Context Propagation in E-commerce

The article explains how to reliably propagate country‑specific context across request handling, database access, and asynchronous thread pools in multi‑country e‑commerce by replacing simple ThreadLocal and InheritableThreadLocal with Alibaba’s TransmittableThreadLocal, demonstrating its integration with Spring MVC/Boot, MyBatis, Dubbo, and custom executors for both sharded and non‑sharded databases.

AlibabaInheritableThreadLocalJava Concurrency
0 likes · 16 min read
TransmittableThreadLocal Practice: Solving Multi-Country Business Context Propagation in E-commerce