[squeak] Question about ProcessorScheduler

Tim Rowledge rowledge at interval.com
Sun Nov 15 04:21:03 UTC 1998


On Sat 14 Nov, John (Zhijiang) Han wrote:
> Hi, 
> 
> I'm wondering whether Squeak ProcessorScheduler is pre-emptive or not,
> i.e. if there are two processes with the same priority, are their
> execution interleaved or they actually execute one after another, given
> that both will run a long time individually. 
There is nothing in the scheduler that will do this interleaving for you.
Any higher priority process that is #resume'd will take over, but same or
lower priority processes haveto wait their turn, which as you say can be
quite a wait.

One 'classical' approach to working around this is to add a 'Processor
yield' send in assorted loops such as Controller>controlLoop  or
View>stretchFrame:startingWith: . Another oft suggested trick is t make a
high priority process that is simply a loop waiting on a short Delay, so
that the process list gets stirred up ocasionally. This pretty much relies
on the suspended process being put atthe back of the queue for its priority
level in order to work. Some people think that this is the wrong way to do
things. IIRC, VisualWorks puts suspended processes at the front of the
queue.

At Interval we have implemented a new process scheduler that allows
real-time task scheduling and (for want of a better term at this time of
night) 'proper' interrupt handling, preemption etc. We hope to release this
code sometime soon.

tim


-- 
Eagles may soar, but weasels aren't sucked into jet engines.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list