Skip to content
  • Ben Gamari's avatar
    4413828b
    rts: Teach getNumProcessors to return available processors · 4413828b
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously we would report the number of physical processors, which
    can be quite wrong in a containerized setting. Now we rather return how
    many processors are in our affinity mask when possible.
    
    I also refactored the code to prefer platform-specific since this will
    report logical CPUs instead of physical (using
    `machdep.cpu.thread_count` on Darwin and `cpuset_getaffinity` on FreeBSD).
    
    Fixes #14781.
    4413828b
    rts: Teach getNumProcessors to return available processors
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously we would report the number of physical processors, which
    can be quite wrong in a containerized setting. Now we rather return how
    many processors are in our affinity mask when possible.
    
    I also refactored the code to prefer platform-specific since this will
    report logical CPUs instead of physical (using
    `machdep.cpu.thread_count` on Darwin and `cpuset_getaffinity` on FreeBSD).
    
    Fixes #14781.
Loading