[uae] Re: Some Progress With the Cocoa GUI

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Fri, 15 Apr 2005 23:51:32 -0500

Hi Axel

On Friday 15 April 2005 08:49 pm, Axel Dörfler wrote:
> That sounds interesting. How are you going to do this?

Well, I'm really looking at other timer APIs and even trying to guage whether 
using a plain old gettimeofday() has much of an in impact on performance on 
the various host platforms.

OS X is easy to improve, though. The Mach kernel provides functions to get the 
PPC timebase counter and query its tick rate (thus no calibration is required 
and Mach's calibration should be more accurate anyway). I don't know if 
frequency scaling has an effect on the timebase register, however (since 
AFAIK it's not directly tied to CPU frequency, it might not).

> Under BeOS, BTW you can easily read out the frequency of CPU, but that
> would probably help you only if you knew how fast the CPU in question
> is, right?

How accurate is the frequency read-out - that is, is it actually measured by 
BeOS? If it is accurate then that should be enough, since (AFAIK) the TSC 
frequency is always the same as the clock frequency (knowing the CPU type 
might help to determine the situations where it's not).

> At least, one could remember the CPU model, and its speed, so that you
> would only need to recalibrate if the model has changed.


I'd actually like to find other high-resolution/low-overhead timers on x86 
platforms because of the problem that frequency-scaling has on the TSC. This 
means finding appropriate OS-specific high-resolution timer APIs.

Linux is a bit of a pain. Unfortunately I would suspect that very few people 
have a kernel built with high-resolution timer suppport. ;-)

> (And some day, I promise, I will do the GUI integration :-))

That's okay. I haven't had as much spare time as would like at the moment, 
either. ;-)


Other related posts: