Squeak does not do pre-emptive multitasking.

Peter Crowther Peter at ozzard.org
Sat Jun 10 23:53:42 UTC 2006


> From: Michael van der Gulik
> Subject: Squeak does not do pre-emptive multitasking.

Correct, with the following proviso: higher-priority processes *will* pre-empt lower-priority processes.

> #(12127412 12126870 12127386 12127374 12127362 0 0 0 0 0)
> #(21112051 21112060 21111787 0 0 0 0 0 0 0)
> #(25767847 25768314 25767577 0 0 0 0 0 0 0)
> #(31379008 31378493 0 0 0 0 0 0 0 0)

Interesting - I'd be fascinated to know why the numbers are so similar.  Do you have some higher-priority process interrupting at regular intervals?  That would account for the rough equality of the numbers, as it would perturb the scheduling of the lower-priority threads, causing threads after the first to be scheduled.

> Either:
> 
> - My code is borked, which is entirely possible,
> - The ProcessScheduler is buggy, or
> - Squeak is meant to work like this.
> 
> Which of those is true?

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;

- 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).

Just my £0.02 when tired after a gig - don't take any of this as gospel!

		- Peter



More information about the Squeak-dev mailing list