🧠 What is Aging (or Ageing)?

Aging is a technique used in CPU scheduling to gradually increase the priority of waiting processes so that they eventually get the CPU and don’t starve.


🎯 Why Aging?

When a process has been waiting in the ready queue for too long, the system:

  • Boosts its priority periodically

  • This ensures that it doesn’t wait forever, even in a priority-based scheduling system


🧩 Example (Priority Scheduling without Aging)

TimeProcessPriority (Lower is better)
0P11
1P21
2P31
3P45 ← Low priority
  • P4 may never run because new high-priority processes keep arriving

  • This is starvation


✅ With Aging

  • Every 5 seconds, increase P4’s priority by 1 step

  • Eventually:
    P4 priority: 5 → 4 → 3 → 2 → 1

  • Now it competes fairly and gets CPU


⚙️ How It’s Implemented (Simple Pseudocode)

for process in ready_queue:
    if process.wait_time > aging_threshold:
        process.priority -= 1  # higher priority
  • aging_threshold can be tuned (e.g., 10 seconds)

  • The lower the priority value, the sooner it gets CPU


🧠 Key Points

PropertyValue
📦 TypeDynamic priority adjustment
✅ PreventsStarvation in priority-based and SJF algorithms
🧠 Common InMultilevel Feedback Queues, Linux CFS
🧪 TradeoffSlightly more complex scheduler, but fairer

🧠 Interview-Ready Definition:

Aging is a technique used to prevent starvation by gradually increasing the priority of waiting processes in the ready queue. This ensures that even low-priority or long-duration jobs eventually get scheduled for CPU execution.


🧠 One-Liner for Interviews:

“Aging prevents starvation by slowly boosting a waiting process’s priority until it gets its fair turn.”


🖥️ Real-World Analogy

You’re at the end of a queue at a food stall.
Every 5 minutes, you’re allowed to move one position forward — even if VIPs keep arriving.
Eventually, you get your food — that’s aging.