summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-12-21 01:20:18 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-12-21 01:20:18 +0100
commita4c0a0eb0d2a872ab7a45e47fcf37ef1fde5b012 (patch)
treee3d5b78fef7d6ecbbd292e0f081283eaefec5ffb /docs
parent58c4b1f83c531c0c61d153eb85eb8c7cac2e3449 (diff)
downloadpsutil-a4c0a0eb0d2a872ab7a45e47fcf37ef1fde5b012.tar.gz
Rename cpu_count_physical() to cpu_count_cores()
This has always been cause of confusion, e.g. see: https://github.com/giampaolo/psutil/pull/1727#issuecomment-698934643 Removed the reference to "physical" from dostrings, functions and test. I still left it in the doc though, as it's more explanatory. Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 8c3b432b..d452c51c 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -205,13 +205,13 @@ CPU
Return the number of logical CPUs in the system (same as `os.cpu_count`_
in Python 3.4) or ``None`` if undetermined.
- *logical* cores means the number of physical cores multiplied by the number
+ "logical CPUs" means the number of physical cores multiplied by the number
of threads that can run on each core (this is known as Hyper Threading).
- If *logical* is ``False`` return the number of physical cores only (Hyper
- Thread CPUs are excluded) or ``None`` if undetermined.
+ If *logical* is ``False`` return the number of physical cores only, or
+ ``None`` if undetermined.
On OpenBSD and NetBSD ``psutil.cpu_count(logical=False)`` always return
``None``.
- Example on a system having 2 physical hyper-thread CPU cores:
+ Example on a system having 2 cores + Hyper Threading:
>>> import psutil
>>> psutil.cpu_count()
@@ -219,11 +219,11 @@ CPU
>>> psutil.cpu_count(logical=False)
2
- Note that this number is not equivalent to the number of CPUs the current
- process can actually use.
+ Note that ``psutil.cpu_count()`` may not necessarily be equivalent to the
+ actual number of CPUs the current process can use.
That can vary in case process CPU affinity has been changed, Linux cgroups
- are being used or on Windows systems using processor groups or having more
- than 64 CPUs.
+ are being used or (in case of Windows) on systems using processor groups or
+ having more than 64 CPUs.
The number of usable CPUs can be obtained with:
>>> len(psutil.Process().cpu_affinity())