Skip to content

Remove DummyThread from threading._active when thread dies #114423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fabioz opened this issue Jan 22, 2024 · 1 comment
Closed

Remove DummyThread from threading._active when thread dies #114423

fabioz opened this issue Jan 22, 2024 · 1 comment
Labels
type-feature A feature request or enhancement

Comments

@fabioz
Copy link
Contributor

fabioz commented Jan 22, 2024

Feature or enhancement

Proposal:

This has bothered me quite a bit already: If some code calls threading.current_thread() in a thread that’s not created from the threading module it lingers at threading._active forever (or until another thread with the same thread.ident is created, which isn’t that uncommon).

My suggestion would be to remove it when the thread dies.

I'll provide a PR.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/remove-dummythread-from-threading-active-when-thread-dies/41322

Linked PRs

@Bangyourkitty

This comment was marked as spam.

aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants