[Xastir-dev] Re: Another case of high load

Curt, WE7U archer at eskimo.com
Fri Sep 10 12:12:49 EDT 2004


On Thu, 9 Sep 2004, Henk de Groot wrote:

> When I use 100 the load is gone, except that I see an activity boost every
> second.
>
> I suspect that something has changed in Xwindows, otherwise I can't
> understand why the problem surfaced again, you added this delay ages ago.

They switched to a different flavor of X-windows in Cygwin a while
back.


> Okay, bumping up nexttime too high is not nice, so I tried something else.
> At the very last line of UpdateTime I added a "usleep(2)" for force 2 micro
> seconds extra delay. Well, that works, the load on lsass.exe dropped to 8%.
> Changing usleep(2) to usleep(100) didn't help more however(!). So I added
> two times usleep(2) instead. Load on lsass.exe dropped to 8% with that.
>
> Aparently the granularity of XtAppAddTimeOut ans usleep it not fine-grained
> enough (on Cygwin). My guess is that whatever small value you use on
> usleep, it will at least wait one timer-tick; so two times usleep(2) adds
> more time than once usleep(100)...
>
> Anyway, this part is very implementation dependent as it is now. I guess a
> real solution is to rewrite this. Keep a sorted timer list and just sleep
> until the next timer will run off, that's much more efficient and robust
> that the polling mechnism we have now (but of course more complex code).

For now we could add a couple of "usleep(2)" calls but add #ifdef's
for Cygwin around them.  Sound good?

--
Curt, WE7U			         http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir-dev mailing list