bpo-37266: Daemon threads are now denied in subinterpreters#14049
Merged
vstinner merged 4 commits intopython:masterfrom Jun 14, 2019
vstinner:subinterp_daemon_thread
Merged
bpo-37266: Daemon threads are now denied in subinterpreters#14049vstinner merged 4 commits intopython:masterfrom vstinner:subinterp_daemon_thread
vstinner merged 4 commits intopython:masterfrom
vstinner:subinterp_daemon_thread
Conversation
In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
Member
Author
|
Oops. Typo in my PR title: "bpo-37266: Daemon threads are now denied in subinterpreters". |
Member
Author
I chose to add the new function the _thread module to not add a dependency (import) between thread and . For example, I would prefer that threading doesn't import _xxsubintepreters. The module is private, its API is a work-in-progress and it may pull other things which are not needed by threads. |
* use print() using flush=True * make the read end of the pipe non-blocking to avoid hanging forever
lisroach
pushed a commit
to lisroach/cpython
that referenced
this pull request
Sep 10, 2019
…-14049) In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
DinoV
pushed a commit
to DinoV/cpython
that referenced
this pull request
Jan 14, 2020
…-14049) In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a subinterpreter, spawning a daemon thread now raises an
exception. Daemon threads were never supported in subinterpreters.
Previously, the subinterpreter finalization crashed with a Pyton
fatal error if a daemon thread was still running.
daemon thread and the method is called from a subinterpreter.
https://bugs.python.org/issue37266