FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-104341: Clean Up threading Module by ericsnowcurrently · Pull Request #104552 · python/cpython · GitHub

/ cpython Public

gh-104341: Clean Up threading Module - #104552

Closed
ericsnowcurrently wants to merge 12 commits into
python:mainfrom
ericsnowcurrently:clean-up-threading-module
Closed

gh-104341: Clean Up threading Module#104552
ericsnowcurrently wants to merge 12 commits into
python:mainfrom
ericsnowcurrently:clean-up-threading-module

Conversation

Copy link
Copy Markdown
Member

To fix gh-104341, we need to change the threading module to utilize two locks for each thread: one for if it running (for join()) and one for its overall lifetime, on which Py_EndInterpreter() will wait. This PR cleans things up to make it easier to make that change. As part of that, we move all the module's state out of PyThreadState and PyInterpreterState.

Comment thread Modules/_threadmodule.c
static int
module_threads_reinit(struct module_threads *threads)
{
if (_PyThread_at_fork_reinit(threads->mutex) < 0) {

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems that you're forgot to define a HAVE_FORK, isn't it?

Copy link
Copy Markdown
Member Author

I'm going to abandon this for now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test__xxsubinterpreters is Occasionally Crashing

3 participants


Back | FazBrowse Home | New Git URL