Squeak Daemon: Why doesn't Squeak sleep with zero cpu usage?

Ned Konz ned at squeakland.org
Wed Jan 21 00:20:05 UTC 2004

On Tuesday 20 January 2004 4:02 pm, Peter William Lount wrote:
> > > How can I configure (or how can we change) squeak to run as a good
> "daemon
> > > server" citizen?
> >
> > Try Squeak 3.7a. It seems to be much better. Of course, you'll want to
> close
> > all the windows too.
> > - Ned Konz
> Hi,
> I've yet to find squeak 3.7a on unix. (See my earlier email today about
> that).

What do you mean? I was referring to the 3.7a image, not VM. I'm using the 
same 3.6g-2++ VM for both tests, and the 3.6 image had around 4% CPU usage 
and the 3.7a image had about 0.5%.

> I've closed all the windows (on the 3.6g unix version) and that seems to
> help a little, it's now hovering just over 1% per image. Ok, I've doubled
> the number of images to a 100. Now to add an infinite number (up to ram and
> disk swap space limits) by figuring out the last 1% and having squeak sleep
> with it's gui active! Any ideas?
> The gui is still polling right?

Not exactly, but Morphic does provide its morphs with stepping behavior. Which 
does require waking up from time to time to see if anything needs to be 
stepped, and then going back to sleep.

What's happening (and this is probably overly complicated, but...) there is a 
high-priority IO task that's mostly blocked waiting for events to come up 
from the VM. These get stuffed into a SharedQueue that is then read by the UI 
task as part of its loop. Of course, if there are no UI interactions, there's 
nothing to do then.

So the loop reduces to:
	* deal with I/O if any (there isn't)
	* do any stepping that's necessary (probably not any of this either)
	* refresh the damaged regions (which there won't be any of)

Also turn off the higherPerformance and cpuWatcherEnabled prefs.

Ned Konz
Stanwood WA
(360) 629-1091

More information about the Squeak-dev mailing list