Skip to content

Commit 5bc1853

Browse files
authored
[BLOG] tweaks for free-threading one year recap post (#918)
1 parent 258a526 commit 5bc1853

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

apps/labs/posts/free-threaded-one-year-recap.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ data is implicitly shared between threads.
3535

3636
Having said that, it is not possible for packages that ship compiled code in
3737
their release distributions to support the free-threaded build out of the box.
38-
Any package shipping native code (many Python packages do that) will need to be
39-
audited to ensure the package builds and either fix or document the safety
40-
guarantees provided by the package. Disabling the GIL required deep structural
41-
changes to the CPython interpreter. Fully supporting the free-threaded build in
42-
existing packages similarly requires fixing structural issues that until now
43-
were not big problems. Things like use of global state in the implementation of
44-
a C extension for convenience or for performance are no longer safe, since the
45-
GIL does not protect simultaneous access from Python to the global state,
46-
allowing undefined behavior via data races. While it is possible to trigger
47-
thread safety issues like this using the `threading` module even with the GIL,
48-
most of the time the GIL prevented these issues from surfacing. The
49-
free-threaded build makes fixing these issues much more pressing.
38+
Any package shipping native code (many Python packages do that) need to be
39+
audited to ensure the package builds and does not suffer thread-safety issues
40+
that are impossible on the GIL-enabled build.
41+
42+
Disabling the GIL required deep structural changes to the CPython
43+
interpreter. Fully supporting the free-threaded build in existing packages
44+
similarly requires fixing structural issues that until now were not big
45+
problems. Things like use of global state in the implementation of a C extension
46+
for convenience or for performance are no longer safe, since the GIL does not
47+
protect simultaneous access from Python to the global state, allowing undefined
48+
behavior via data races. While it is possible to trigger thread safety issues
49+
like this using the `threading` module even with the GIL, most of the time the
50+
GIL prevented these issues from surfacing. The free-threaded build makes fixing
51+
these issues much more pressing.
5052

5153
## Major accomplishments
5254

@@ -55,7 +57,7 @@ enable support for free-threaded Python in a long list of packages and
5557
projects, including:
5658

5759
* Packaging and project workflow tools like meson, meson-python, the
58-
setup-python GitHub workflow, packaging, pip, and setuptools.
60+
setup-python GitHub Actions workflow, packaging, pip, and setuptools.
5961
* Bindings generators like Cython, pybind11, f2py, and PyO3.
6062
* Foundational packages in the PyData ecosystem like NumPy, SciPy, PyArrow,
6163
Matplotlib, pandas, scikit-learn, and scikit-image.
@@ -75,7 +77,7 @@ that will ship in CPython 3.14:
7577
with a configuration option or runtime command-line flag.
7678
* Significant thread safety issues in `asyncio` have been fixed. Our
7779
benchmarks indicate substantially improved parallel scaling of code using
78-
asyncio with a thread pool runner as a function of thread count.
80+
asyncio with a thread pool runner.
7981
* Thread safety overhaul in the `ctypes` module.
8082
* Substantial performance improvements for the free-threaded garbage collector.
8183
* Helped implement the deferred reference counting scheme used by the
@@ -87,10 +89,10 @@ that will ship in CPython 3.14:
8789
* A huge number of smaller bugfixes and thread safety improvements.
8890

8991
We've also written a [comprehensive guide](https://py-free-threading.github.io)
90-
for supporting free-threading in existing apps and packages gleaned from our
91-
experiences. Our hope is that the documentation we've written can be a valuable
92-
resource for the "long tail" of packages that people will want to update to
93-
support free-threaded Python in the coming years.
92+
for supporting free-threaded Python in existing apps and packages gleaned from
93+
our experiences. Our hope is that the documentation we've written can be a
94+
valuable resource for the "long tail" of packages that people will want to
95+
update to support free-threaded Python in the coming years.
9496

9597
You can also read more about this effort from the team at Meta on the
9698
[Meta engineering blog](https://engineering.fb.com/2025/05/05/developer-tools/enhancing-the-python-ecosystem-with-type-checking-and-free-threading/).
@@ -105,9 +107,9 @@ these issues were not due to fundamental problems but because of unsupported
105107
default options or minor assumptions broken on the free-threaded build.
106108

107109
Together with package maintainers and other contributors in the community,
108-
we have fixed all of these issues and today things are much better. With the
110+
we have fixed many of these issues and today things are much better. With the
109111
release of Cython 3.1.0, which ships official support for the free-threaded
110-
build, we also helped fix one of the most significant source of build issues.
112+
build, we also helped fix one of the most significant sources of build issues.
111113

112114
We are currently working on packages that ship compiled code but still do not
113115
yet ship free-threaded wheels. You can track our progress using our manually

0 commit comments

Comments
 (0)