JavaScript Tutorial

Starvation in Concurrency

Situation where a process is indefinitely delayed due to resource allocation.

// In promise handling, starvation can occur if microtasks are endlessly scheduled
function starve() {
  Promise.resolve().then(starve);
}
starve(); // May starve macrotasks