Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7222] thread reaping is imperfect

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 27, 2009, 2:24 PM

Post #1 of 5 (231 views)
Permalink
[issue7222] thread reaping is imperfect

New submission from Antoine Pitrou <pitrou [at] free>:

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
test_socketserver.

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>
<http://bugs.python.org/issue7222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2009, 3:14 PM

Post #2 of 5 (228 views)
Permalink
[issue7222] thread reaping is imperfect [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Thinking about it, another possibility is to strengthen Thread.join(),
so that it waits for the actual end of the thread, not a small instant
before.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2009, 4:25 PM

Post #3 of 5 (214 views)
Permalink
[issue7222] thread reaping is imperfect [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Forget the last message. While improving Thread.join() can be good, it
still doesn't guarantee that all references have been released.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2009, 4:41 PM

Post #4 of 5 (221 views)
Permalink
[issue7222] thread reaping is imperfect [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Here's a new patch with tests.

----------
Added file: http://bugs.python.org/file15217/threading_setup2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 30, 2009, 10:25 AM

Post #5 of 5 (227 views)
Permalink
[issue7222] thread reaping is imperfect [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Committed in r75958, r75959.

----------
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.