Hacker News new | ask | show | jobs
by jeffbee 1300 days ago
If you have a long standing queue, switching to LIFO makes sense. It requires you to know how long the requests have been waiting, however, and many servers don't even have this basic information. Every request needs to come with a deadline and a timestamp, so the request processor can make rational decisions about processing or dropping it. If a service finds a request that arrived a long time ago and sat in the queue until the deadline was in the past, that's a fairly good signal to temporarily switch to LIFO processing.

LIFO processing in the steady state is not a great idea because it will stochastically starve some requests for no reason.

1 comments

In the steady state, the queue or stack should be nearly empty, no? It's only when shocks occur, as the article describes, that a lock convoy forms.