Number of CPU detected by Bind 9.4.0

ecu ecu at ecute.org
Wed Mar 7 13:58:00 UTC 2007


Hello,

I have just installed the new version of bind 9.4.0 on my HP-DL360G4which have 2 CPU
working with multithreading enabled but it seems bind does not detect correctly the number of
CPU. I compiled it with the --enable-threads flag and launched it with the -n 4 flag and
actually here
is what appears in the log:

Mar  6 15:10:35 xxxx named[325]: found 1 CPU, using 4 worker threads

so i decided to have a look in the source code to see how is detected this number of CPU and i
found in lib/isc/unix/os.c that bind is using the following function to get it
34: sysconf((_SC_NPROCESSORS_ONLN)); (and yes in the ./config.log I have sysconf detected)

so i took my vi to write this little code:

#include <stdio.h>
#include <unistd.h>

int main()
{
                printf("ncpus: %d\n", sysconf((_SC_NPROCESSORS_ONLN)));
                return(0);
}

and here the result:
ncpus: 4

So did i miss something in the source code ? or is it a bug known in bind 9.4.0 ?
My operating system is debian sarge with a standard 2.6.8-3 smp kernel

thanks forward for your answer

Julien




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the bind-users mailing list