Skip to content

Commit b81dbd2

Browse files
Clarify about thread state independence.
1 parent 8de5e0a commit b81dbd2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Doc/reference/executionmodel.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,16 @@ call stack. It may include other thread-specific resources.
561561

562562
Each thread state, over its lifetime, is always tied to exactly one
563563
interpreter and exactly one host thread. It will only ever be used in
564-
that thread. In the other direction, a host thread may have many
565-
Python thread states tied to it, for different interpreters or even the
566-
same interpreter. However, for any given host thread, only one of the
567-
thread states tied to it can be used by the thread at a time.
564+
that thread and with that interpreter.
565+
566+
In the other direction, a host thread may have many Python thread states
567+
tied to it, for different interpreters or even the same interpreter.
568+
However, for any given host thread, only one of the thread states
569+
tied to it can be used by the thread at a time.
570+
571+
Thread states are isolated and independent from one another and don't
572+
share any data, except for possibly sharing an interpreter and objects
573+
or other resources belonging to that interpreter.
568574

569575
Once a program is running, new Python threads can be created using the
570576
:mod:`threading` module (on platforms and Python implementations that

0 commit comments

Comments
 (0)