[haiku-development] Re: cpu_clock_speed -- why gone?

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 18 Mar 2017 14:42:13 -0700

On Sat, Mar 18, 2017 at 05:30:53AM +0100, Adrien Destugues wrote:

Hah!  So that's how it was done.  Interesting!

So can one expect that to be the case as long as BeOS compatibility
is maintained?  I dummied up a 'SysInfoBeOS.h' using the old BeOS
struct and a "get_BeOS_system_info(...)" call that invokes the
legacy "_get_system_info(...)" from the OS.  Gets me back the original
behaviour.  Is this  a horrible thing to do? (:-/)

It was removed from there for a good reason. The API was reworked and
extended to provide more accurate info about the CPUs, which can run at
different frequencies. The new scheduler uses this information to make
better guesses at which CPU to use.

Ah, that's the reason...  Seems a little odd, though.  I can understand
CPUs and GPUs having different clocks ,but multiple CPUs running the
same instruction set?  Are there any machines on the market that
have such chips?

You can use get_cpu_topology_info to get the number of cores, and the
default frequency for each. 

OK.  Thanks for pointing to that.  [No wonder I couldn't find it -- I was
searching for "..clock..", not "frequency"! (:-)]  I see that the legacy
system_info interface just looks at the first core in the list to get its
clock value.

I did some more experiments with a large canvas, and it looks like
the original ArtPaint scheme is somewhat important.  It nicely
degraded the dynamic bitmap enough to keep things smooth.
[I'm rather in awe of Heikke's expertise, here!]  So I think I'll go
with my current plan of get_BeOS_system_info(...) and assume
the compatibilty interface will stay around.

Thanks,

        -- Pete --

Other related posts: