Preemptive scheduling
J J
azreal1977 at hotmail.com
Wed May 2 06:43:07 UTC 2007
Aha. Ok. Thanks everyone who answered. This is what I was wondering. I
suppose looking back, it seems silly not to realize that since all
instructions are passing through the VM that the VM would watch what a
process is doing and preempt them if necassary. But all the VM's I have
been exposed to were purely cooperative (for speed reasons I suppose), so it
didn't occur to me that it wouldn't be the same here.
>From: "Martin v. Löwis" <martin at v.loewis.de>
>Reply-To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Re: Preemptive scheduling
>Date: Tue, 01 May 2007 22:56:38 +0200
>
> > 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
>
_________________________________________________________________
Dont quit your job Take Classes Online and Earn your Degree in 1 year.
Start Today!
http://www.classesusa.com/clickcount.cfm?id=866146&goto=http%3A%2F%2Fwww.classesusa.com%2Ffeaturedschools%2Fonlinedegreesmp%2Fform-dyn1.html%3Fsplovr%3D866144
More information about the Squeak-dev
mailing list
|