Getting # Physical CPUs

dsimcha dsimcha at yahoo.com
Wed Jul 14 07:39:00 PDT 2010


When I do parallel programming in D, it's nice to have a sane default for the
number of threads.  The ideal number is the number of cores that can see the
current address space.  core.cpuid provides coresPerCPU, but it doesn't appear
to provide nPhysialCPUs or something similar, which would allow the total
number of physical CPUs in the system to be determined.  Is there any easy way
to determine this in D2?


More information about the Digitalmars-d mailing list