It doesn't necessarily need VM support, I don't think, although it may be nice to hook into checkForInterrupts. I guess it would run at highIOPriority and I would like to adjust the priorities of the resumable processes. Perhaps run a logarithmic schedule. Is this feasible? Does anyone have this kinda code?
are you deep squeakin', yet? ;-) Rob
The canonical example of this is simply a high priority loop waiting on a Delay. Each time the Delay fires it will stir up the process list at the priority of the suspended process (and by extension any other priority level that might get involved) assuming of course that the suspend is implemented to add the suspended process at the back of the list. Not all systems actually do that - VW used to put it at the front of thelist and so the same process would get resumed. Might still be like that for all I know.
I think there is all the VM support you need already there, what with the Delay etc. Note that checkForInterrupts is already involved since it is the mechanism by which the Delay termination is noticed!
I imagine that it might be useful to add some VM support to directly deal with a special timer for process stirring and thereby reduce by a small amount the allocating and setting up of actual Delay objects, but it would be a pretty minimal improvement I suspect. tim
Tim Rowledge wrote:
The canonical example of this is simply a high priority loop waiting on a Delay. Each time the Delay fires it will stir up the process list at the priority of the suspended process (and by extension any other priority level that might get involved) assuming of course that the suspend is implemented to add the suspended process at the back of the list. Not all systems actually do that - VW used to put it at the front of thelist and so the same process would get resumed. Might still be like that for all I know.
So, the switcher will have to perhaps change the priorities of the workers to give them each a proportional time slice.
I think there is all the VM support you need already there, what with the Delay etc. Note that checkForInterrupts is already involved since it is the mechanism by which the Delay termination is noticed!
I saw that, I think. There is an interrupt timer setup in the VM.
I imagine that it might be useful to add some VM support to directly deal with a special timer for process stirring and thereby reduce by a small amount the allocating and setting up of actual Delay objects, but it would be a pretty minimal improvement I suspect.
I going to try tomorrow.
Rob
(G'night)
tim
-- Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim Never write software that anthropomorphizes the machine.
squeak-dev@lists.squeakfoundation.org