Skip to content

Commit cd0200c

Browse files
Avoid talking about how threads are scheduled.
1 parent 8f454c4 commit cd0200c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Doc/reference/executionmodel.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,18 +414,22 @@ on the computer look something like this::
414414
Hosts and processes are isolated and independent from one another.
415415
However, threads are not.
416416

417-
While a program always starts with exactly one thread, known as the
418-
"main" thread, it may grow to run in multiple. Not all platforms
419-
support threads, but most do. For those that do, each thread does *run*
420-
independently, for the small segments of time it is scheduled to execute
421-
its code on the CPU. Otherwise, all threads in a process share all the
422-
process' resources, including memory.
417+
A program always starts with exactly one thread, known as the "main"
418+
thread, it may grow to run in multiple. Not all platforms support
419+
threads, but most do. For those that do, all threads in a process
420+
share all the process' resources, including memory.
421+
422+
Each thread does *run* independently, at the same time as the others.
423+
That may be only conceptually at the same time ("concurrently") or
424+
physically ("in parallel"). Either way, the threads run at a
425+
non-synchronized rate, which means global state isn't guaranteed
426+
to stay consistent for any given thread.
423427

424428
.. note::
425429

426430
The way they share resources is exactly what can make threads a pain:
427-
two threads running at the same arbitrary time on different CPU cores
428-
can accidentally interfere with each other's use of some shared data.
431+
two threads running at the same time can accidentally interfere with
432+
each other's use of some shared data.
429433

430434
The same layers apply to each Python program, with some extra layers
431435
specific to Python::

0 commit comments

Comments
 (0)