AsyncLocal<T>

E697536

AsyncLocal<T> is a .NET type that provides ambient data storage local to a given asynchronous control flow, allowing values to flow with async calls without using thread-local storage.

All labels observed (1)

Label Occurrences
AsyncLocal<T> canonical 2

How this entity was disambiguated

Statements (46)

Predicate Object
instanceOf generic class ⓘ
reference type ⓘ
apiSurface minimal API with Value property and optional change callback ⓘ
assembly System.Private.CoreLib (in .NET Core / .NET 5+) ⓘ
System.Threading (in some .NET Core versions) ⓘ
linked to: System.Threading

mscorlib (in .NET Framework) ⓘ
linked to: mscorlib.dll
behavior value does not automatically flow to new threads without ExecutionContext flow ⓘ
value is captured and restored across async awaits ⓘ
category concurrency utility ⓘ
context propagation primitive ⓘ
contrastWith ThreadLocal<T> which is bound to a specific thread ⓘ
definedIn System.Threading namespace ⓘ
linked to: System.Threading
design uses ExecutionContext to flow values ⓘ
values are copied when ExecutionContext is captured ⓘ
documentation documented on Microsoft Learn ⓘ
genericTypeParameter T ⓘ
hasConstructor AsyncLocal() ⓘ
AsyncLocal(Action<AsyncLocalValueChangedArgs<T>> valueChangedHandler) ⓘ
hasEventLikeCallback ValueChanged ⓘ
hasProperty Value ⓘ
ValueChanged ⓘ
introducedIn .NET Core 1.0 ⓘ
linked to: .NET Core

.NET Framework 4.6 ⓘ
linked to: .NET Framework
lifetime lives as long as the AsyncLocal<T> instance is referenced ⓘ
partOf .NET Base Class Library ⓘ
platform .NET 5+ ⓘ
linked to: .NET (5 and later)

.NET Core ⓘ
.NET Framework ⓘ
purpose allow values to flow with async calls ⓘ
avoid reliance on thread-local storage in async code ⓘ
provide ambient data storage local to an asynchronous control flow ⓘ
relatedTo AsyncFlowControl ⓘ
CallContext ⓘ
ExecutionContext ⓘ
ThreadLocal<T> ⓘ
scope value flows with async continuations ⓘ
value is scoped to the current async control flow ⓘ
supports asynchronous call context data ⓘ
logical call context propagation ⓘ
threadAffinity not bound to a specific thread ⓘ
threadSafety Value property is thread-safe for simple get and set operations ⓘ
usagePattern commonly used for ambient configuration or security context ⓘ
commonly used for logging correlation identifiers ⓘ
commonly used for per-request context in ASP.NET Core ⓘ
valueAccessibility Value property is gettable and settable ⓘ
valueChangeNotification ValueChanged callback invoked when value changes in current or parent context ⓘ

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 → AsyncLocal<T> ⓘ
ExecutionContext → relatedTo → AsyncLocal<T> ⓘ