Implication of variable context switching time

1

I know that constant switching time of the Linux scheduler was a big achievement.

What would be the implication of a non-constant switching time?

The only obvious reason I can think of is real-time systems where we have to meet deadlines. There it is obviously not ideal if the switching time is "random". Are there any other good reasons that favour constant switching times?

Rob

Posted 2010-01-29T12:54:18.573

Reputation:

Answers

1

If I understand your question correctly, the main concern is latency vs. throughput, and this is a tradeoff with no universal solution. For audio or video playback, you want low latency, which you will achieve at the cost of more frequent task switching, which means lost throughput. For a supercomputer running physics simulations, you want to maximise throughput, which means less task switching, and therefore higher latency, unpredictable context switching time.

For a practical example, there is linux software that will do the same thing that a digital guitar effects box does. In the configuration you have to select a buffer size manually, because with a larger buffer you are less likely to get audio clicks and dropouts, because there are fewer context switches during audio processing, but you get a noticeable audio delay, because of the buffer size. With a lower buffer size you can reduce that delay, but the shorter you get the delay, the more often you will get clicks, skips, and dropouts in the audio.

Justin Smith

Posted 2010-01-29T12:54:18.573

Reputation: 3 746