[BUG][Linux] VM2.8 port eats processor cycles

Stephan Rudlof sr at evolgo.de
Thu Jun 29 00:14:00 UTC 2000


Tim Rowledge wrote:
> 
> In message <395A8532.6272A67E at evolgo.de> you wrote:
> 
> > There is a bug somewhere. Possibly I have found the origin, see below.
> [snip]
> > There is a socketPollFunction, which has to be set by
> > setSocketPollFunction( int spf), because it is initialized to 0;
> > grep'ing for setSocketPollFunction() reveals:
> >
> > sr at Klaus:~/Squeak/2.8/src > grep setSocketPollFunction *.c *.h
> > ../interp.c
> > sqXWindow.c:void setSocketPollFunction( int spf) {
> >
> > . It won't be called! So ioRelinquishProcessorForMicroseconds() returns
> > *very* fast and the idle process doesn't give processor cycles to the
> > OS.
> Well, sorta.
> The setSocketPollFunction is called by the socket plugin (remember, you
> have to grep _all_ the sources)

Ooops, sorry, I have missed this.

> in its initialiseModule() code. So if
> you haven't done a socket call, then yes I guess you never go to sleep.

That's it.

> Hmm, anyone know how to handle something like this? Is there a sleep
> type of call that will do partial seconds? Seems kind of poor to require
> people to do a socket call in order to sleep!

Solution:

Just evaluate
	NetNameResolver resolverError
(shouldn't do too much ;-) ) and the module will be initialized:
 initialiseModule() -> socketInit() -> setSocketPollFunction()
.

This is a workaround!

Greetings,

Stephan

> 
> tim
> 
> --
> Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
> Useful Latin Phrases:- Ventis secundis, tene cursum. = Go with the flow.

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list