Starvation
Starvation is a condition in which a task persistently lacks the resources or execution opportunities needed to make progress while competing work proceeds.
Troubleshooting Java, Second Edition
A concurrency condition in which a thread is unfairly excluded from obtaining execution time or a required resource.
- How it is used
- Diagnoses whether lock contention unfairly excludes threads from execution in multithreaded applications.
- How deep it goes
- Defines unfair exclusion and traces it through sampling, lock counts, monitors, affected threads, and execution time.
- Examples
- Uses producer-consumer threads sharing an ArrayList, balanced lock counts, monitor histories, and aggregated profiler statistics.
- What you can do after
- Diagnose starvation with sampling and lock profiling, then evaluate changes that reduce waiting or rebalance thread execution.
Read how Troubleshooting Java, Second Edition explains starvation →
Learn Concurrent Programming with Go
Starvation is a situation in which an execution is blocked from gaining access to a shared resource because other executions keep it unavailable for a long time or indefinitely.
- How it is used
- Diagnoses unfair shared-resource access and motivates write-preferring readers–writer locks.
- How deep it goes
- Explains the failure sequence and implements lock-state checks, condition waits, counters, and broadcasts.
- Examples
- Uses two looping Go readers, a waiting writer, indefinite output, and a write-preferring lock that prints “Write finished.”
- What you can do after
- Build it from scratch using condition variables and mutexes to prevent write starvation in a readers–writer lock.
Read how Learn Concurrent Programming with Go explains starvation →
C# Concurrency: Asynchronous and multithreaded programming
Starvation is a concurrency condition in which a thread is prevented from making progress because another thread retains a required resource for an excessive time.
- How it is used
- Diagnoses multithreading failures where locks or processor time prevent otherwise runnable threads from progressing.
- How deep it goes
- Explains lock and CPU mechanisms through infinite-loop programs, then compares Windows and Linux scheduling behavior.
- Examples
- Uses competing console writers, an indefinitely held lock, processor affinity, and AboveNormal thread priority.
- What you can do after
- Diagnose starvation by distinguishing excessive lock duration from CPU monopolization and apply shortest-duration lock guidance.
Read how C# Concurrency: Asynchronous and multithreaded programming explains starvation →
Grokking Concurrency
Starvation is a concurrency failure in which a task is indefinitely denied the resources or execution opportunities needed to make progress.
- How it is used
- Diagnoses starvation as a concurrency failure alongside deadlocks and livelocks.
- How deep it goes
- Explains resource denial, scheduling causes, priority effects, and aging, but does not detail an implementation of fair scheduling.
- Examples
- Uses dining philosophers, chopstick locks, dumpling counts, and unequal philosopher output to demonstrate unfair progress.
- What you can do after
- Diagnose starvation by tracing resource access, scheduling, priorities, synchronization, and task load.
Related concepts
- lockless techniqueproduced by · Lock-free is a concurrency progress property that guarantees some operation completes within a finite number of steps despite contention, without relying on mutual-exclusion locks.
- write-preferring readers-writer lockaddressed by · A write-preferring readers-writer lock is a readers-writer synchronization lock that prioritizes waiting writers to prevent prolonged writer blocking.
- livelockincludes · A livelock is a concurrency failure in which active threads or tasks repeatedly respond to one another without making useful overall progress.
- fair-share schedulingaddressed by · Fair-share scheduling is an operating-system scheduling algorithm that distributes CPU usage among users or groups rather than equally among individual processes.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



