[cello-devel] High CPU load also on Linux!

Kenny Tilton ktilton at nyc.rr.com
Thu Mar 11 00:04:34 UTC 2004

Frank Goenninger wrote:

>On Wed, 2004-03-10 at 22:35, Frank Goenninger wrote:
>>Yep. I think we actually have one. A beast. But some ideas hereto:
>>You already coded an idle callback function and also get the "OS 
>>real time" in that function. So why not just save the realtime when
>>a redisplay has been posted? The next redisplay only gets posted if
>>there is a certain difference between the last posting and the current
>>This difference should be settable such that one can tune the app
>>here to differing needs.
>>Will try that and report back.
>Tried. No luck. What I did:
>(defun w-post-redisplay (self)
>  (let ((w (glut-get-window))
>        (gw (glutw self)))
>    (c-assert gw)
>    (glut-set-window gw)
>    (count-it :post-redisplay)
>    ;; HACK: ADDED by frgo ...
>    (when (> (- (os-TickCount) (tickCount self)) 100000)
>      (print "Posting REDISPLAY !")      
>      (trc nil "posting redisplay" self (glutw self) :currentw w)
>      (glut-post-redisplay)
>      (setf (tickCount self) (os-TickCount)))
>    (c-assert w)
>    (glut-set-window w)))
>With that I do receive only very rarely that "Posting REDISPLAY !" 
>message. CPU load remains high.
Ah, but I was a bad boy and used a direct (glut-post-redisplay) to 
implement the display-continuous attribute:

(def-Window-callback mg-glut-display ()
  (trc nil "mg-glut-display > entry" (glutgetwindow))
  (let ((*selecting* nil)
    (unless (c-stopped);; progn ;; handler-case
        (progn ;; with-metrics (t t "mg-glut-display")
          (trc nil "mg-glut-display > about to render w " *w* 
          ;;(trace ix-render)
          (let (*render-clip-l* *render-clip-r* *render-clip-t* 
            (ix-render *w*))
            (incf (frame-ct *w*))
            (trc nil "mg-glut-display > rendered w " *w* (glutgetwindow))
            (when (display-continuous *w*)
              (trc nil "mg-glut-display > posting redisplay w " *w* 
bingo>    (glut-post-redisplay))

You can enable one of the print statements here to know for sure the app 
is not displaying continuously.

The code you slowed up was the code that deals with smart refresh: any 
cell that affects the display gets an echo function which eventually 
calls w-pot-redisplay. something like a frame counter on the screen 
which changes its text 1-2-3 every time redisplay gets called will thus 
effectively force continuous redisplay, because it changes every time 
and echos every time and thus reposts a display every time.

You defeated that by having that code check to see if a bunch of real 
time has gone by, but the display-continuous handling bypasses that.



Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 

Your Project Here! http://alu.cliki.net/Industry%20Application

More information about the cello-devel mailing list