Moving Sessions and Tools Without a Gap

Lesson 3 of 4

Run the Work That Fits the Budget

Estimated time: 10 minutes

Admit the work that fits the remaining budget

A queue that runs strictly in arrival order will start a long task with little budget left and then fail it at the deadline, wasting the room a short task could have used. The estimate matters more than the queue position.

Check the estimate before the position

Every task carries a budget estimate. Admit the work whose estimate fits what is left, and hold the rest for the next window rather than starting it.

Downgrade instead of failing

When a task will not fit, run a smaller version or defer it. Starting work that cannot finish spends the budget and delivers nothing.

def admit(task, remaining):
    return task.est_budget <= remaining

Keep headroom for urgent work

Leave a slice of the budget unspent so an urgent task arriving late still fits. A window that spends everything early has no room for the work that cannot wait.