Skip to content

gh-162705: Sync QSBR state on PyErr_CheckSignals - #163109

Open
johng wants to merge 1 commit into
python:mainfrom
johng:gh-162705-checksignals-qsbr
Open

johng wants to merge 1 commit into
python:mainfrom
johng:gh-162705-checksignals-qsbr

Conversation

@johng

@johng johng commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

On PyErr_CheckSignals sync global QSBR state into thread copy.

This allows for long running C functions which are expected to call this to help unblocked deferred QSBR memory in FT build from other threads.

On `PyErr_CheckSignals` sync global QSBR state into thread copy.

This allows for long running C functions which are expected to call
this to help unblocked deferred QSBR memory in FT build from other
threads.
@read-the-docs-community

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · cpython-previews · built Dec. 3, 2026, 8:54 p.m. UTC

@johng

johng commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Running the reproduction from the issue with sorted(words) replaced by 7 ** 1_500_000 (one ~0.22 s C call, which calls PyErr_CheckSignals() from x_mul):

build GIL peak RSS before peak RSS after (runs 1 / 2 / 3)
default build on 153 MB 207 / 204 / 204 MB
free-threaded off 199 MB 2,257 / 2,286 / 2,256 MB
free-threaded + quiescent state in PyErr_CheckSignals() off 199 MB 268 / 275 / 276 MB

@nascheme nascheme left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants