https://github.com/python/cpython/commit/05c9474ed96ab55df8de5bd4a7f4bd27bb5e020f
commit: 05c9474ed96ab55df8de5bd4a7f4bd27bb5e020f
branch: 3.13
author: Lysandros Nikolaou <[email protected]>
committer: lysnikolaou <[email protected]>
date: 2026-02-11T18:08:49+01:00
summary:
[3.13] gh-142518: Define lock-free and per-object lock (GH-144548) (#144707)
(cherry picked from commit 12dbae4c02dac197330d5bfa650b495e962aba6d)
files:
M Doc/glossary.rst
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 030c4968b42513..488bcc53258765 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -882,6 +882,16 @@ Glossary
to locks exist such as queues, producer/consumer patterns, and
thread-local state. See also :term:`deadlock`, and :term:`reentrant`.
+ lock-free
+ An operation that does not acquire any :term:`lock` and uses atomic CPU
+ instructions to ensure correctness. Lock-free operations can execute
+ concurrently without blocking each other and cannot be blocked by
+ operations that hold locks. In :term:`free-threaded <free threading>`
+ Python, built-in types like :class:`dict` and :class:`list` provide
+ lock-free read operations, which means other threads may observe
+ intermediate states during multi-step modifications even when those
+ modifications hold the :term:`per-object lock`.
+
loader
An object that loads a module.
It must define the :meth:`!exec_module` and :meth:`!create_module`
methods
@@ -1139,6 +1149,16 @@ Glossary
<faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the
:ref:`function` section, and :pep:`362`.
+ per-object lock
+ A :term:`lock` associated with an individual object instance rather than
+ a global lock shared across all objects. In :term:`free-threaded
+ <free threading>` Python, built-in types like :class:`dict` and
+ :class:`list` use per-object locks to allow concurrent operations on
+ different objects while serializing operations on the same object.
+ Operations that hold the per-object lock prevent other locking operations
+ on the same object from proceeding, but do not block :term:`lock-free`
+ operations.
+
path entry
A single location on the :term:`import path` which the :term:`path
based finder` consults to find modules for importing.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]