summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-12-10 16:33:11 (GMT)
committerGitHub <noreply@github.com>2024-12-10 16:33:11 (GMT)
commitc91ccbe4ac0ec15c503521f539b3528db85871b4 (patch)
treef96337c4bcde0b6832fc4d49c713261d680e1d9b /Doc
parent9af96f440618304e7cc609c246e1f8c8b2d7a119 (diff)
downloadcpython-c91ccbe4ac0ec15c503521f539b3528db85871b4.zip
cpython-c91ccbe4ac0ec15c503521f539b3528db85871b4.tar.gz
cpython-c91ccbe4ac0ec15c503521f539b3528db85871b4.tar.bz2
gh-59705: Set OS thread name when Thread.name is changed (#127702)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/threading.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index d4b343d..f183f3f 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -434,6 +434,18 @@ since it is impossible to detect the termination of alien threads.
Multiple threads may be given the same name. The initial name is set by
the constructor.
+ On some platforms, the thread name is set at the operating system level
+ when the thread starts, so that it is visible in task managers.
+ This name may be truncated to fit in a system-specific limit (for example,
+ 15 bytes on Linux or 63 bytes on macOS).
+
+ Changes to *name* are only reflected at the OS level when the currently
+ running thread is renamed. (Setting the *name* attribute of a
+ different thread only updates the Python Thread object.)
+
+ .. versionchanged:: 3.14
+ Set the operating system thread name.
+
.. method:: getName()
setName()