deadlock
A state where two or more pieces of work each wait for the other forever, so none can continue.
In more detail
Each party holds something the other needs, such as a lock, and waits for the other to let go first. The program keeps running but makes no progress.
Examples
.NET: calling .Result on a task where a synchronization context needs the blocked thread; await instead.A deadlocked process is what a liveness probe and restart are for.Related terms
- blocking on async code — Calling .Result or .Wait() on a task so that a thread sits idle until the async work finishes.
- synchronization context — An object that decides which thread an await resumes on, used by user-interface frameworks and older ASP.NET.
- thread — A path of execution inside a process that the operating system schedules on a processor; one process can have many.
- liveness probe — A health check that answers only whether a process is alive enough to keep running; if it keeps failing, the orchestrator, such as Kubernetes, restarts it.
- mutex — A lock that lets only one piece of code at a time run a critical section or do a particular piece of work.
Taught in
- Async and Await: Managing Concurrency — Modern .NET Core, C# & Enterprise Microservices
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices
- Health Probes & Graceful Shutdown: Kubernetes Lifecycles — Production Full-Stack Engineering