Thread Local

Noun · Development

Definitions

  1. A variable storage mechanism where each thread gets its own independent copy of the data, avoiding synchronization overhead — commonly used to store per-request context like user identity, database connections, or transaction IDs in multithreaded servers.

    In plain English: A variable that each thread has its own private copy of, so threads don't interfere with each other.

    Example: "We stash the request trace ID in a thread-local so every log line in the call chain can include it without passing it explicitly."

Related Terms