Getting # Physical CPUs

Don nospam at nospam.com
Wed Jul 14 08:00:52 PDT 2010


dsimcha wrote:
> 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?

coresPerCPU is a misnomer. It's actually the total number of cores. Will 
fix.


More information about the Digitalmars-d mailing list