# Threading

**URL:** https://discuss.python.org/c/threading/38.md

[Latest](https://discuss.python.org/latest.md) · [Categories](https://discuss.python.org/categories.md) · [Tags](https://discuss.python.org/tags.md)

---

## [About the Threading category](https://discuss.python.org/t/about-the-threading-category/88680)

<div class="topic-metadata">

**Author:** [@ambv](https://discuss.python.org/u/ambv)\
**Replies:** 0\
**Last updated:** [April 17, 2025, 4:10pm UTC](https://discuss.python.org/t/about-the-threading-category/88680 "2025-04-17T16:10:57Z")

</div>

Discussion of multithreaded Python programming, thread safety, and multithreaded parallelism. This is not a support category: for questions related to using threading, write in Python Help.

---

## [Improving multithreaded scaling in NumPy](https://discuss.python.org/t/improving-multithreaded-scaling-in-numpy/108331)

<div class="topic-metadata">

**Author:** [@ngoldbaum](https://discuss.python.org/u/ngoldbaum)\
**Replies:** 4\
**Last updated:** [August 7, 2026, 11:14am UTC](https://discuss.python.org/t/improving-multithreaded-scaling-in-numpy/108331 "2026-08-07T11:14:03Z")

</div>

@kumaraditya303 just published a post on the Quansight blog I thought might be of interest here. It summarizes work he led and I helped out on to improve multithreaded scaling of NumPy. I suspect there will be a lot of d…

---

## [Migratable execution contexts for free-threading: a tiny "allocation-home" hook (pre-PEP, seeking feedback + a sponsor)](https://discuss.python.org/t/migratable-execution-contexts-for-free-threading-a-tiny-allocation-home-hook-pre-pep-seeking-feedback-a-sponsor/107860)

<div class="topic-metadata">

**Author:** [@robertsdotpm](https://discuss.python.org/u/robertsdotpm)\
**Replies:** 5\
**Last updated:** [July 25, 2026, 4:47am UTC](https://discuss.python.org/t/migratable-execution-contexts-for-free-threading-a-tiny-allocation-home-hook-pre-pep-seeking-feedback-a-sponsor/107860 "2026-07-25T04:47:31Z")

</div>

TL;DR Free-threaded CPython welds a thread state’s allocation to the OS thread it runs on, which blocks the whole category of userspace M:N schedulers / green threads / stackful coroutines: a lightweight task’s executi…

---

## [Thread safety now and in the future (no-gil)](https://discuss.python.org/t/thread-safety-now-and-in-the-future-no-gil/104297)

<div class="topic-metadata">

**Author:** [@shortcut](https://discuss.python.org/u/shortcut)\
**Replies:** 91\
**Last updated:** [November 10, 2025, 1:01pm UTC](https://discuss.python.org/t/thread-safety-now-and-in-the-future-no-gil/104297 "2025-11-10T13:01:06Z")

</div>

Hello. I’ve read PEP 703 and tried to understand what disabling GIL in future releases means for thread safetiness and how to writing code today which will also run flawlessly when GIL is disabled. Would it be safe to …

---

## [Some notable missing pieces ahead of freethreading](https://discuss.python.org/t/some-notable-missing-pieces-ahead-of-freethreading/100712)

<div class="topic-metadata">

**Author:** [@mikeshardmind](https://discuss.python.org/u/mikeshardmind)\
**Replies:** 29\
**Last updated:** [August 16, 2025, 3:40pm UTC](https://discuss.python.org/t/some-notable-missing-pieces-ahead-of-freethreading/100712 "2025-08-16T15:40:55Z")

</div>

Sorry if this comes off as “asking too much”, not my intent here, just putting together a list of things I’ve noticed absent that may be more relevant and worth considering including in the language itself. Currently lim…

---

## [Using reduce() for Multithreaded Aggregation](https://discuss.python.org/t/using-reduce-for-multithreaded-aggregation/99897)

<div class="topic-metadata">

**Author:** [@dpdani](https://discuss.python.org/u/dpdani)\
**Replies:** 0\
**Last updated:** [July 23, 2025, 7:24pm UTC](https://discuss.python.org/t/using-reduce-for-multithreaded-aggregation/99897 "2025-07-23T19:24:45Z")

</div>

Hello :waving\_hand: I’ve posted two examples to the documentation of cereggii on usages for AtomicDict, which was presented at the 2024 Language Summit. Using reduce() for Multithreaded Aggregation Using reduce() for …

---

## [Free-threaded library status website](https://discuss.python.org/t/free-threaded-library-status-website/90807)

<div class="topic-metadata">

**Author:** [@corona10](https://discuss.python.org/u/corona10)\
**Replies:** 8\
**Last updated:** [June 19, 2025, 6:38pm UTC](https://discuss.python.org/t/free-threaded-library-status-website/90807 "2025-06-19T18:38:07Z")

</div>

Just for share: https://ft-checker.com/ For now, it only checks whether the Top 1000 PyPI packages can be installed on Free-threaded CPython, but it still gives a reasonably accurate view of what builds successfully. I…

---

## [Slower performance with --disable-gil on threaded nearest-neighbor benchmark (10M points)](https://discuss.python.org/t/slower-performance-with-disable-gil-on-threaded-nearest-neighbor-benchmark-10m-points/95365)

<div class="topic-metadata">

**Author:** [@basileMarchand](https://discuss.python.org/u/basileMarchand)\
**Replies:** 19\
**Last updated:** [June 17, 2025, 8:46pm UTC](https://discuss.python.org/t/slower-performance-with-disable-gil-on-threaded-nearest-neighbor-benchmark-10m-points/95365 "2025-06-17T20:46:46Z")

</div>

Summary I am currently benchmarking the performance of the experimental --disable-gil mode in Python 3.14b2. In most CPU-bound cases, I observed excellent improvements (×3–×4 speedups). However, in one more realistic te…

---

## [Put a version of \`threading\_helper\` on pypi?](https://discuss.python.org/t/put-a-version-of-threading-helper-on-pypi/88768)

<div class="topic-metadata">

**Author:** [@ngoldbaum](https://discuss.python.org/u/ngoldbaum)\
**Replies:** 6\
**Last updated:** [June 11, 2025, 3:03pm UTC](https://discuss.python.org/t/put-a-version-of-threading-helper-on-pypi/88768 "2025-06-11T15:03:40Z")

</div>

I recently learned about the threading\_helper, module in the private test package CPython ships. Is there any problem with factoring it out into its own pip-installable project, assuming I keep the PSF license? It seems…

---

## [Please take race conditions seriously when discussing threading](https://discuss.python.org/t/please-take-race-conditions-seriously-when-discussing-threading/93339)

<div class="topic-metadata">

**Author:** [@markshannon](https://discuss.python.org/u/markshannon)\
**Replies:** 66\
**Last updated:** [May 29, 2025, 1:23pm UTC](https://discuss.python.org/t/please-take-race-conditions-seriously-when-discussing-threading/93339 "2025-05-29T13:23:41Z")

</div>

On discussions of free-threading, one comment I see repeated is that free-threading doesn’t introduce race-conditions. The claim is that the race conditions were already present, and free-threading just makes it more lik…

---

## [Free-threaded Python toy: pgo\_task with threads](https://discuss.python.org/t/free-threaded-python-toy-pgo-task-with-threads/88683)

<div class="topic-metadata">

**Author:** [@nas](https://discuss.python.org/u/nas)\
**Replies:** 9\
**Last updated:** [May 11, 2025, 10:01pm UTC](https://discuss.python.org/t/free-threaded-python-toy-pgo-task-with-threads/88683 "2025-05-11T22:01:35Z")

</div>

I’ll get this discussion started with a little toy people might want to play with. I’ve created an alternative PGO task for Python, using benchmarks from pyperformance. Since it is designed to run all of those benchmar…

---

## [Free-threaded Python guides and docs](https://discuss.python.org/t/free-threaded-python-guides-and-docs/88708)

<div class="topic-metadata">

**Author:** [@nas](https://discuss.python.org/u/nas)\
**Replies:** 1\
**Last updated:** [April 18, 2025, 11:50am UTC](https://discuss.python.org/t/free-threaded-python-guides-and-docs/88708 "2025-04-18T11:50:06Z")

</div>

There were likely posted elsewhere but I’ll post them here again: Python free-threading guide: this is a good place to start! Howto for Python free-threading support Howto for C API Extension support for free-threadin…
