[Issue 19513] Use sched_getaffinity(2) to get the number of CPU cores if available

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 24 03:33:45 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19513

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot at dlang.rocks> ---
@kubo39 created dlang/phobos pull request #7030 "Fix Issue 19513 - Use
sched_getaffinity(2) to get the number of CPU cores if abailable" fixing this
issue:

- Fix Issue 19513 - Use sched_getaffinity(2) to get the number of CPU
  cores if available

  Currently std.parallelism.totalCPUs is implemented by
  sysconf(_SC_NPROCESSORS_ONLN) on Posix platoform. However, on GNU/Linux,
  usable number of processors may be restricted if a process runs in
  container. In case it's better to use sched_getaffinity(2).

  ref: http://man7.org/linux/man-pages/man1/nproc.1.html

https://github.com/dlang/phobos/pull/7030

--


More information about the Digitalmars-d-bugs mailing list