- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
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
Conversation
HAVE_THREAD_LOCAL macro is defined.| Hmm, I'm still getting the same error I mentioned earlier. Somehow the  | 
| Do I need to pass   | 
| Hm, you're defining  | 
| 
 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.
| I just pushed a new commit, where  | 
| 
 This works now. -- 
 I missed that mypyc is defining  | 
| @cdce8p Would you please check that mypyc still works after the new changes? | 
| 
 Just ran the whole test suite again. Looks good. | 
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