[Top][All Lists]

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

[PATCH] support for accessing CPU/core count (processor-count)

From: Campbell Barton
Subject: [PATCH] support for accessing CPU/core count (processor-count)
Date: Sun, 10 Oct 2021 11:02:32 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

Hi, this patch adds support for accessing the number of CPU's / cores on a system, matching CPython's multiprocessing.cpu_count() [0].

I've only tested this for Linux, this includes code that should work on other platforms, although that would need to be double-checked of course.
For reference I checked CPython / Blender & Stack-overflow [1]

Accessing this information can be useful to automatically detect the number of jobs to run.

[0]: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count
[1]: https://stackoverflow.com/a/3006416/432509

Attachment: 0001-processor-count.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]