File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -152,3 +152,33 @@ to re-enable it in a thread-safe way in the 3.14 release. This overhead is
152152expected to be reduced in upcoming Python release. We are aiming for an
153153overhead of 10% or less on the pyperformance suite compared to the default
154154GIL-enabled build.
155+
156+
157+ Behavioral changes
158+ ==================
159+
160+ This section describes CPython behavioural changes with the free-threaded
161+ build.
162+
163+
164+ Context variables
165+ -----------------
166+
167+ In the free-threaded build, the flag :data: `~sys.flags.thread_inherit_context `
168+ is set to true by default. In the default GIL-enabled build, the flag
169+ defaults to false. This will cause threads created with
170+ :class: `threading.Thread ` to start with a copy of the
171+ :class: `~contextvars.Context() ` of the caller of
172+ :meth: `~threading.Thread.start `. If the flag is false, threads start with an
173+ empty :class: `~contextvars.Context() `.
174+
175+
176+ Warning filters
177+ ---------------
178+
179+ In the free-threaded build, the flag :data: `~sys.flags.context_aware_warnings `
180+ is set to true by default. In the default GIL-enabled build, the flag defaults
181+ to false. If the flag is true then the :class: `warnings.catch_warnings `
182+ context manager uses a context variable for warning filters. If the flag is
183+ false then :class: `~warnings.catch_warnings ` modifies the global filters list,
184+ which is not thread-safe. See the :mod: `warnings ` module for more details.
You can’t perform that action at this time.
0 commit comments