Nonpreemptive Processes???

Raab, Andreas Andreas.Raab at disney.com
Thu Sep 28 17:26:12 UTC 2000


> Processes are not preemptive *at the same priority*. A higher 
> priority process will preempt a lower one when whatever the 
> higher one was waiting on (a Semaphore) becomes ready. So 
> some choices:
> 
> - To share time between equal priority processes, use 
> 'Processor yield' from time to time

Alternatively, put up one high priority process that does nothing but:

	| delay |
	delay := Delay forMilliseconds: 50.
	[true] whileTrue:[delay wait].

Since the scheduler activates the processes in order all processes at the
same priority will get a chance to run for 50msecs each. [note: the above
seems to be a bit expensive but process switches are rather cheap].

  - Andreas





More information about the Squeak-dev mailing list