Re: getting processor numbers

Andi Kleen
2007-04-03T17:35:10Z

On Tue, Apr 03, 2007 at 10:30:47AM -0700, Ulrich Drepper wrote:
> Andi Kleen wrote:
> > Topology is dependent on the number of CPUs.
>
> Not all of it.

What is not?

> We might add very limited caching (for a few
> seconds) but that's as much as we can go.

Hmm, e.g. in OpenMP you would have another thread that just reads /proc/cpuinfo
in a loop and starts new threads on new CPUs?

That sounds ...... "expensive"

The other use case in glibc I know of is the Opteron optimized
memcpy which can use different functions depending on the number of
cores. But having a separate thread regularly rereading cpuinfo for
memcpy also sounds quite crazy.

-Andi