tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: devel/py-joblib patch



On Fri, Dec 29, 2023 at 08:02:44AM -0600, Jason Bacon wrote:
>              cpu_count_physical = int(cpu_info)
> +        # Maybe also openbsd, dragonfly, etc?
> +        elif sys.platform.startswith('freebsd') or
> sys.platform.startswith('netbsd'):
> +            cpu_info = subprocess.run(
> +                "sysctl -n hw.ncpu".split(),
> +                capture_output=True,
> +                text=True,
> +            )
> +            cpu_info = cpu_info.stdout
> +            cpu_count_physical = int(cpu_info)

This sounds pretty expensive, can't it use os.sysconf(NPROCESSORS_CONF) ?

Martin


Home | Main Index | Thread Index | Old Index