Thursday, February 01, 2007

 

Fairness is for Wusses

You got to queue some tasks, so you put it in a FIFO or multiple FIFOs and RR them right? If the system is blogged down, then everyone still gets there fair share of the resources and get blogged down evenly.

Think about that for a second. Say you got sever whose clients all start to run some heavy processing application at the same time. You let them all run, and everyone will complain that it's too slow and the system is unusable. No one is happy in this scenario.

What would happen if you used an unfair system like a stack for the task queue? The last people to start the application gets all the CPU cycles and their applications run fine. The first people to start the application times out and have to try back later. Some people are happy in this scenario. The worst case wait period, in theory, is just as bad as the worst case wait period in the FIFO scenario, but the user experience on average is much better.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?