Skip to content
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

bpo-42745: Make the type cache per-interpreter #23947

Merged
merged 1 commit into from
Dec 26, 2020
Merged

bpo-42745: Make the type cache per-interpreter #23947

merged 1 commit into from
Dec 26, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 25, 2020

Make the type attribute lookup cache per-interpreter.

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.

https://bugs.python.org/issue42745

@vstinner
Copy link
Member Author

MCACHE_ prefix stands for "method cache", I chose to leave it unchanged.

@vstinner
Copy link
Member Author

My PR is wrong:

 7 tests failed:
     test__xxsubinterpreters test_ast test_atexit test_capi test_embed
     test_interpreters test_threading

@vstinner
Copy link
Member Author

This PR can be tested using PR #20085.

Make the type attribute lookup cache per-interpreter.

Add _PyType_InitCache() function, called by PyInterpreterState_New().

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.

Continue to share next_version_tag between interpreters, since static
types are still shared by interpreters.
@vstinner
Copy link
Member Author

My PR is wrong: (...)

It should now be fixed: I added _PyType_InitCache() and I left next_version_tag unchanged.

@vstinner vstinner merged commit 4101018 into python:master Dec 26, 2020
@vstinner vstinner deleted the method_cache branch December 26, 2020 00:45
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Make the type attribute lookup cache per-interpreter.

Add private _PyType_InitCache() function, called by PyInterpreterState_New().

Continue to share next_version_tag between interpreters, since static
types are still shared by interpreters.

Remove MCACHE macro: the cache is no longer disabled if the
EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants