3 ms·
> Just look at a modern scheduler and see what it saves whenever it context switches: that's your minimum set. I'd call that an upper bound on the size of the
by frabert 7y ago
> Just look at a modern scheduler and see what it saves whenever it context switches: that's your minimum set.
I'd call that an upper bound on the size of the minimum set, one that is guaranteed to work with any kind of program. With more info on the executing program you could probably save less state and still keep the program running fine
- nybble41 7y agoIt's not an upper bound either since the data saved on context-switch doesn't include the contents of the stack or data segment or other global process state. It's not sufficient to save and restore only the thread context. One upper bound, mentioned in the article, would be the inputs fed to the program thus far and the total number of instructions executed. Another would be the current thread context plus all working memory and other process state, excluding any data which can be proven not to be accessed for the remainder of the program. Which of these is smaller would depend on the program and where it was stopped; at the beginning you just have a (small) counter and no inputs consumed, but then again you may have fed the program gigabytes of inputs and stopped it just before it returned a small amount of summary data.