← 返回首页
[3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921) by ericsnowcurrently · Pull Request #110707 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

[3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921)#110707

Merged
ericsnowcurrently merged 7 commits into
python:3.12from
ericsnowcurrently:backport-1dd9dee-subinterpreters-allow-background-threads
Nov 28, 2023
Merged

[3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921)#110707
ericsnowcurrently merged 7 commits into
python:3.12from
ericsnowcurrently:backport-1dd9dee-subinterpreters-allow-background-threads

Conversation

ericsnowcurrently commented Oct 11, 2023
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

The existence of background threads running on a subinterpreter was preventing interpreters from getting properly destroyed, as well as impacting the ability to run the interpreter again. It also affected how we wait for non-daemon threads to finish.

We add PyInterpreterState.threads.main, with some internal C-API functions.

(cherry-picked from commit 1dd9dee)

… Consistently (pythongh-109921) The existence of background threads running on a subinterpreter was preventing interpreters from getting properly destroyed, as well as impacting the ability to run the interpreter again. It also affected how we wait for non-daemon threads to finish. We add PyInterpreterState.threads.main, with some internal C-API functions. (cherry-picked from commit 1dd9dee)
Comment thread Modules/main.c Show resolved Hide resolved
Comment thread Include/internal/pycore_interp.h Outdated Show resolved Hide resolved
ericsnowcurrently merged commit 0122b4d into python:3.12 Nov 28, 2023
ericsnowcurrently deleted the backport-1dd9dee-subinterpreters-allow-background-threads branch November 28, 2023 02:01
ericsnowcurrently added a commit that referenced this pull request Nov 28, 2023
gh-110707 (0122b4d) added some tests that didn't close file descriptors they created, leading to failures on the refleak buildbots. This closes the leaking file descriptors, resolving the failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.