ThreadLocal<T>

E697522

ThreadLocal<T> is a .NET generic class that provides thread-local storage, allowing each thread to have its own independently initialized value of a given type.

All labels observed (1)

Label Occurrences
ThreadLocal<T> canonical 2

How this entity was disambiguated

Statements (46)

Predicate Object
instanceOf .NET generic class ⓘ
thread-local storage abstraction ⓘ
behavior Values enumerates values from all threads that have created them ⓘ
each thread sees its own Value instance ⓘ
category concurrency utility ⓘ
state management utility ⓘ
constraint T can be any reference or value type ⓘ
definedIn System.Threading namespace ⓘ
linked to: System.Threading
designedFor multi-threaded applications ⓘ
parallel programming scenarios ⓘ
documentation https://learn.microsoft.com/dotnet/api/system.threading.threadlocal-1 ⓘ
ensures each thread has its own value of type T ⓘ
hasConstructor ThreadLocal<T>() ⓘ
ThreadLocal<T>(Func<T> valueFactory) ⓘ
ThreadLocal<T>(Func<T> valueFactory, bool trackAllValues) ⓘ
hasMember IsDisposed (bool) ⓘ
IsValueCreated (bool) ⓘ
Value (get; set;) ⓘ
Values (IEnumerable<T>) ⓘ
hasMethod Dispose() ⓘ
ToString() ⓘ
hasProperty IsDisposed ⓘ
IsValueCreated ⓘ
Value ⓘ
Values ⓘ
hasTypeParameter T ⓘ
implementsInterface IDisposable ⓘ
introducedIn .NET Framework 4.0 ⓘ
linked to: .NET Framework
lifecycle values are eligible for collection when thread ends or instance is disposed ⓘ
notThreadSafeFor sharing Value across threads ⓘ
partOf .NET Base Class Library ⓘ
platform .NET 5+ ⓘ
.NET Core ⓘ
.NET Framework ⓘ
provides thread-local storage ⓘ
relatedTo AsyncLocal<T> ⓘ
CallContext ⓘ
linked to: ExecutionContext

[ThreadStatic] attribute ⓘ
replacesPattern manual ThreadStatic with initialization logic ⓘ
requires proper disposal to release references early ⓘ
supports Common Language Runtime (CLR) ⓘ
threadAffinity value is unique per thread ⓘ
usagePattern avoid shared mutable state between threads ⓘ
store per-thread state without manual dictionaries ⓘ
valueInitialization can use value factory delegate ⓘ
supports lazy initialization per thread ⓘ

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

System.Threading → containsType → ThreadLocal<T> ⓘ
AsyncLocal<T> → relatedTo → ThreadLocal<T> ⓘ