Skip to content

gh-145685: Stop the world when updating MRO of existing types - #145707

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-145685-stw-mro-update
Mar 9, 2026
Merged

colesbury merged 1 commit into
python:mainfrom
colesbury:gh-145685-stw-mro-update

Conversation

@colesbury

@colesbury colesbury commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

We already have a stop-the-world pause elsewhere in this code path (type_set_bases) and this makes will make it easier to avoid contention on the TYPE_LOCK when looking up names in the MRO hierarchy.

Also use deferred reference counting for non-immortal MROs.

We already have a stop-the-world pause elsewhere in this code path
(type_set_bases) and this makes will make it easier to avoid contention
on the TYPE_LOCK when looking up names in the MRO hierarchy.

Also use deferred reference counting for non-immortal MROs.
@colesbury
colesbury merged commit 0b65c88 into python:main Mar 9, 2026
54 checks passed
@colesbury
colesbury deleted the gh-145685-stw-mro-update branch March 9, 2026 22:41
@colesbury colesbury added the needs backport to 3.14 bugs and security fixes label Mar 9, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @colesbury, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0b65c88c2af6e09530a9aa21800771aa687371db 3.14
colesbury added a commit to colesbury/cpython that referenced this pull request Mar 9, 2026
…types (pythongh-145707)

We already have a stop-the-world pause elsewhere in this code path
(type_set_bases) and this makes will make it easier to avoid contention
on the TYPE_LOCK when looking up names in the MRO hierarchy.

Also use deferred reference counting for non-immortal MROs.
(cherry picked from commit 0b65c88)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

bedevere-app Bot commented Mar 9, 2026

Copy link
Copy Markdown

GH-145715 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Mar 9, 2026
colesbury added a commit that referenced this pull request Mar 10, 2026
…h-145707) (#145715)

We already have a stop-the-world pause elsewhere in this code path
(type_set_bases) and this makes will make it easier to avoid contention
on the TYPE_LOCK when looking up names in the MRO hierarchy.

Also use deferred reference counting for non-immortal MROs.
(cherry picked from commit 0b65c88)
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…ythongh-145707)

We already have a stop-the-world pause elsewhere in this code path
(type_set_bases) and this makes will make it easier to avoid contention
on the TYPE_LOCK when looking up names in the MRO hierarchy.

Also use deferred reference counting for non-immortal MROs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants