On 6 Okt, 12:45, [EMAIL PROTECTED] (Lawrence Oluyede) wrote:
>
> From processing <http://cheeseshop.python.org/pypi/processing/0.34> :

[...]

>             num = os.sysconf('SC_NPROCESSORS_ONLN')

It's interesting what new (or obscure) standard library functions (and
system functions) can be discovered through these kinds of
discussions. However, this one seems to report the number of "virtual
CPUs" in situations like mine where the CPU supports hyperthreading,
as Nicholas Bastin says. One way to get the real number of CPUs (on
Linux-based systems) is to parse /proc/cpuinfo, and to count the
number of distinct "physical id" values.

>From the experiments I've done with pprocess [1], pretending that a
hyperthreading "virtual CPU" is as good as a real CPU (or CPU core)
tends to be counter-productive: the performance benefits in moving
from the utilisation of one to two "virtual CPUs" are virtually non-
existent.

Paul

[1] http://www.python.org/pypi/pprocess

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to