diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-04 23:01:57 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-04 23:01:57 +0200 |
commit | 46042187f58635598c8d7c7a771d131fc4e84ace (patch) | |
tree | 22803f7c78bdce94065602e6e22ed6a3273a0c21 /docs | |
parent | f386b26f565fa7f9bf2beba3145a91114a9a0738 (diff) | |
download | psutil-46042187f58635598c8d7c7a771d131fc4e84ace.tar.gz |
expand Process.threads() doc (take inspiration from #1989)
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/index.rst b/docs/index.rst index f0bf2ba7..498b3094 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1453,9 +1453,16 @@ Process class .. method:: threads() - Return threads opened by process as a list of named tuples including thread - id and thread CPU times (user/system). On OpenBSD this method requires - root privileges. + Return threads opened by process as a list of named tuples. On OpenBSD this + method requires root privileges. + + - **id**: the native thread ID assigned by the kernel. If :attr:`pid` refers + to the current process, this matches the + `native_id <https://docs.python.org/3/library/threading.html#threading.Thread.native_id>`__ + attribute of the `threading.Thread`_ class, and can be used to reference + individual Python threads running within your own Python app. + - **user_time**: time spent in user mode. + - **system_time**: time spent in kernel mode. .. method:: cpu_times() @@ -2967,6 +2974,7 @@ Timeline .. _`subprocess.Popen`: https://docs.python.org/3/library/subprocess.html#subprocess.Popen .. _`temperatures.py`: https://github.com/giampaolo/psutil/blob/master/scripts/temperatures.py .. _`TerminateProcess`: https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-terminateprocess +.. _`threading.Thread`: https://docs.python.org/3/library/threading.html#threading.Thread .. _Tidelift security contact: https://tidelift.com/security .. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-psutil?utm_source=pypi-psutil&utm_medium=referral&utm_campaign=readme .. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-psutil?utm_source=pypi-psutil&utm_medium=referral&utm_campaign=readme |