Squeak does not do pre-emptive multitasking.
Michael van der Gulik
squeakml at gulik.co.nz
Sun Jun 11 05:43:53 UTC 2006
tim Rowledge wrote:
>
> On 10-Jun-06, at 4:53 PM, Peter Crowther wrote:
>
>>> From: Michael van der Gulik
>>> Subject: Squeak does not do pre-emptive multitasking.
>>
>>
>> I've not *found* any bugs in the scheduler, as long as you remember
>> that:
>>
>> - Higher-priority processes pre-empt lower-priority processes;
>>
>> - Processes at the same priority do not pre-empt each other;
>
>
> Exactly. Squeak does do pre-emptive scheduling but does not pre-empt
> within a priority level. When a higher level procees pre-empts, the
> lower process is stuck at the end of the queue of processes waiting for
> time at that priority. Thus you can implement round-robin scheduling
> quite effectively with a Delay in a loop in a high priority process.
> Implementing a scheduler that makes all processes get some time
> depending upon their priority would be a modest extension left as an
> exercise for the student.
Well, I'm not a student anymore, but I might tackle that exercise
because Squeak is pretty lame without it. At the moment I'm just annoyed
that my low priority processes (I assume 10 is low and 80 is high...)
can lock up Squeak. With my 10-process test that I posted, Squeak will
respond to a alt-., but sluggishly if at all. Theoretically it
shouldn't, but it does.
I'm poking around the code now. I guess I'll have to go to the VM code
to work out the finer details. Observations so far:
- Process has a badly named instance variable - "myList".
- The "event tickler" process (EventSensor>>eventTickler) is probably a
good place for some process scheduling seeing that it runs periodically
(currently every 500ms, but that'd need to be 50ms for decent
scheduling). I'd probably start by adding a "timeRunning" variable to
Process which tallies milliseconds spent running and go from there for
fair scheduling.
- Shouldn't the event tickler be running at a higher priority than the
user interupt watcher?
- Processor -> quiescentProcessLists doesn't appear to be used in the
same way as the blue book describes. Infact, it appears to not be used
at all. Where are the process lists? Does the VM not let us see them?
Mikevdg.
More information about the Squeak-dev
mailing list
|