[New-bugs-announce] [issue7222] thread reaping is imperfect

Antoine Pitrou report at bugs.python.org
Tue Oct 27 22:24:24 CET 2009

New submission from Antoine Pitrou <pitrou at free.fr>:

Thread reaping in test_support is imperfect because, even when a thread
has a disappeared from _active and _limbo, the Thread object might still
be hanging somewhere in memory (leaving its last instants). This problem
manifests itself when trying to fix the transient refleaks in

One solution I've found is to add a _count() method to the thread
module, which returns the number of running threads from the point of
view of the C extension. When _count() is decremented, we can be sure
the Python method has finished running and the Thread object is not
hanging around.

components: Tests
files: threading_setup.patch
keywords: patch
messages: 94582
nosy: nnorwitz, pitrou, r.david.murray
priority: normal
severity: normal
stage: patch review
status: open
title: thread reaping is imperfect
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15215/threading_setup.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list