Preemptive scheduling

"Martin v. Löwis" martin at v.loewis.de
Tue May 1 20:56:38 UTC 2007


> Does the Squeak VM do preemptive scheduling or regular yield style
> scheduling.  This may sound like a silly question, but I know Erlang is
> language that does mainly green threads and they are preemptive in
> nature.  They accomplish this by allowing a given thread to execute no
> more then 100 VM instructions before it is preempted (obviously if a
> thread makes a primitive call that is a voluntary yield).
> 
> Does Squeak do this already?

Yes, the Squeak scheduler implements preemptive scheduling. An active
process is given a quantum of such-and-such many byte codes, and when
the quantum expires, a scheduling decision is made. The scheduler
attempts to make each quantum a (tunable) period of time (by default
1ms), and adjusts the number of byte code operations to account for
differences in CPU speed.

Regards,
Martin



More information about the Squeak-dev mailing list