synchronization context
An object that decides which thread an await resumes on, used by user-interface frameworks and older ASP.NET.
In more detail
User-interface frameworks use one so that code after an await runs back on the interface thread. ASP.NET Core has none, but where one exists, blocking on a task can deadlock because the continuation needs the blocked thread.
Related terms
- deadlock — A state where two or more pieces of work each wait for the other forever, so none can continue.
- continuation — The rest of a method that is scheduled to run once an awaited task completes.
- blocking on async code — Calling .Result or .Wait() on a task so that a thread sits idle until the async work finishes.
Taught in
- Async and Await: Managing Concurrency — Modern .NET Core, C# & Enterprise Microservices