Re: getting processor numbers

Dr. David Alan Gilbert
2007-04-03T18:36:39Z

* Ulrich Drepper (drepper@redhat.com) wrote:

> glibc for a long time provides functionality to retrieve the number
> through sysconf() and this is what fortunately most programs use. The
> problem is that we are currently using /proc/cpuinfo since this is all
> there was available at that time. Creating /proc/cpuinfo takes the
> kernel quite a long time, unfortunately (I think Jakub said it is mainly
> the interrupt information).

It's not only expensive to create, it's expensive and annoying to parse;
I don't think it is vaguely consistent accross different architectures
not to mention kernel versions.

Dave
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \
\ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/