4 ms·
This also contains a hidden assumption that reallocation from one task to another is very, very expensive, so it's necessary to name the distribution of resourc
by jerf 2y ago
This also contains a hidden assumption that reallocation from one task to another is very, very expensive, so it's necessary to name the distribution of resources well in advance. This is clearly true for a physical production line. But if you are in the very common circumstance in the computer world where the switching time is significantly less than the amount of progress than can be made on a given task in some time, then the optimum scenario is just to do work as it becomes available, and in many cases, almost any scheduling algorithm that isn't deliberately constructed for maximum pathology will ensure that significant progress is made.
That's why in the vast majority of circumstances you'll be running many things on many CPUs, you just throw all the work at the CPUs and let the chips fall where they may. Deliberate scheduling is a tool, but an unusual one, especially as many times the correct solution to tight scheduling situations is to throw more resources at it anyhow. (Trying to eke out wins by changing your scheduling implies that you're also in a situation where slight increases in workloads will back the entire system up no matter what you do.)
- hinkley 2y agoEven with lambdas you want a bit of server affinity because setup is nontrivial. If the job absolutely needs to get done we can get it done. But the opportunity cost is high and we can’t build a business around it. You want to prefer the warm path over the cold one.
- jerf 2y ago"if you are in the very common circumstance in the computer world where the switching time is significantly less than the amount of progress than can be made on a given task in some time, then the optimum scenario is just to do work as it becomes available" ... and if you aren't, then clearly, by the way "if-then" statements work, the "then" clause doesn't apply.