[Xastir-dev] Big-fix Apology ;-)

Curt, WE7U archer at eskimo.com
Fri Aug 27 17:01:27 EDT 2004


I've been running through the bug-list lately.  We're down to ten
open bugs now, out of 298 listed.  Not bad.

I want to apologize, not for fixing the last bug, but for HOW I
fixed it:

Xastir running.  Step the system clock back by ten seconds (I used
"date -s" to do it).  You'll get near 100% CPU for those ten seconds
until the time catches up again.

I started trying to find the routines that directly caused the
problem, but main.c:UpdateTime() has a lot of calls in it.  Suffice
it to say that I got bored and was looking for a quicker fix.

With the fix we now check whether time went backward.  If it did we
add an extra usleep(1) call into the mix until time catches back up,
plus we output some messages to STDERR:


  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  !!         System time jumped backwards!        !!
  !! Xastir sleeping, else will use excessive CPU !!
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  Xastir is done sleeping due to time reversal.


So... End result is that Xastir is unresponsive until time catches
up, but then again it was before the fix also.  The net gain is that
CPU usage doesn't go to max during this time, taking out the rest of
your system.

If anyone wants to go through the effort to find the root cause of
the high CPU, more power to you.  I don't have the time/energy to do
that right now, particularly because this type of thing won't happen
often.

--
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