Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-140544: Always assume that thread locals are available#140690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-140544: Always assume that thread locals are available #140690
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ZeroIntensity commented Oct 27, 2025 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
HAVE_THREAD_LOCAL macro is defined.cdce8p commented Oct 27, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Hmm, I'm still getting the same error I mentioned earlier. Somehow the |
cdce8p commented Oct 27, 2025
Do I need to pass |
ZeroIntensity commented Oct 27, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Hm, you're defining |
cdce8p commented Oct 27, 2025
That hasn't been an issue so far. The check here works fine / if I remove cpython/Include/internal/pycore_mimalloc.h Lines 4 to 6 in f5394c2
|
This fixes extensions that define Py_BUILD_CORE after including Python.h, but before including pycore_pystate.h, such as mypyc.
ZeroIntensity commented Oct 27, 2025
I just pushed a new commit, where |
cdce8p commented Oct 27, 2025
This works now. --
I missed that mypyc is defining |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kumaraditya303 commented Oct 28, 2025
@cdce8p Would you please check that mypyc still works after the new changes? |
cdce8p commented Oct 28, 2025
Just ran the whole test suite again. Looks good. |
2cefa70 into python:mainUh oh!
There was an error while loading. Please reload this page.
…onGH-140690) Python has required thread local support since 3.12 (see pythonGH-103324). By assuming that thread locals are always supported, we can improve the performance of third-party extensions by allowing them to access the attached thread and interpreter states directly.
Python has required thread local support since 3.12. By assuming that thread locals are always supported, we can improve the performance of third-party extensions by allowing them to access the attached thread and interpreter states directly.
cc @cdce8p