[CM] cmio, gtkloop on OSX

George Khouri gk1@four-four.com
Thu, 16 Jun 2005 16:49:00 -0700


Rick and All,
When I open a cmio window, the added "gtk_main" lisp process forces an otherwise idle OpenMCL (dppccl) process to keep my cpu occupied steadily between 50% - 80% capacity on my 667MHz, 1GB powerbook, running OSX 10.3.8. What's sucking up cpu cycles is the "(loop doing ...)" inside the GTKLOOP function. That is to say, any such loop construct is similarly cpu-intensive in OpenMCL, and it has nothing to do with the gtk implementation. After killing the gkt_main process, dppccl settles down to a normal < 1% cpu usage.
Since the gtk interface just passes gui info back and forth (I think), I've experimented with having the "(loop doing ...)" statement SLEEP on each iteration, without any noticable ill effects for the limited testing I've done, but I'm not sure what might break or not work at all. (I know it's ugly.)

It appears the smallest SLEEP value for OpenMCL is 0.01 sec, i.e., (sleep 0.01). This sleep call in the loop pretty much frees up my cpu (< 1% ) but drawing the gkt widgets is  visibly slower. 
Putting (ccl::%nanosleep 0 1000000) in the loop appears to sleep about a millisecond. My cpu peaks out at about 5%-7%. This seems to be the best of both worlds.

Is this worth considering at least until a polling technique can be made to work for GTKLOOP on OpenMCL?  My Powerbook has a very noisy, annoying fan which goes on when the cpu is busy so I'm desperate!

Thanks,
George Khouri
--------
George Khouri
gk1@four-four.com
(415) 282-7560