Squeak does not do pre-emptive multitasking.
tim Rowledge
tim at rowledge.org
Sun Jun 11 01:09:13 UTC 2006
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.
>
> - A loop that forks processes that run at a higher priority than
> the loop's process may never complete, as it may fail to get enough
> cycles to fork the remaining processes after the first (a swift
> test would be to increment an instance variable in the loop, and
> see how many you actually get).
You can certainly get confusing results in some cases.
tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- He hasn't a single redeeming vice.
More information about the Squeak-dev
mailing list
|