www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22340] New: totalCPUs may not return accurate number of CPUs


          Issue ID: 22340
           Summary: totalCPUs may not return accurate number of CPUs
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: razvan.nitu1305 gmail.com

Taken from Ruby source code [1]:

"man page says CPU_ALLOC takes number of cpus. But it is not accurate
explanation. sched_getaffinity() returns EINVAL if cpuset bitmap is smaller
than kernel internal bitmap. That said, sched_getaffinity() can fail when a
kernel have sparse bitmap even if cpuset bitmap is larger than number of cpus."


Sep 28 2021