3 ms·
"What I like about the elevator question is that elevator algorithms are their own science." Are they? I think they have analogies in task schedulers. You have
by Someone 12y ago
"What I like about the elevator question is that elevator algorithms are their own science."
Are they? I think they have analogies in task schedulers. You have things like fairness guarantees (maximizing number of trips made or people moved is not ideal, as that could keep someone waiting for an elevator for weeks), livelock (elevators being stuck on short trips between floors 1 and 2 with people waiting forever on floor 55), elevator/CPU affinity (if we know it is highly likely that the person on floor 14 wants to go to floor 7, we might not let the elevator going past it to floor 3 stop at 14, but schedule the elevator now a few floors higher that we knew will stop at 7 stop there instead, but if we are fairly sure he wants to go to floor 6, where the elevator is going anyways, we might want the first elevator to stop there)
For the "ground floor in the morning" thing, task schedulers can switch behavior, too, for example by detecting the difference between batch-like and GUI-like programs. Extreme example (probably far-fetched): in embedded systems, the task scheduler could even know, say, when Wall Street opens, and make sure the cron task that should run then is paged in when it does.