This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2005-01-06.17:16:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Presumably, by changing threading.Semaphore to stop using 
any code from threading.py, then threading.currentThread() 
never gets called and so a _DummyThread is never created 
then.

I expect the reason a _DummyThread causes Event leaks is 
just that Thread.__init__ always ends up allocating a Python 
lock (Thread.__block), which allocates a Windows Event 
under the covers.

It *could* be that Thread.__block is never actually used for 
dummy threads, in which case we could avoid allocating it in 
that case (or could get rid of it right way in 
_DummyThread.__init__).  The dummy thread would still clog 
the _active dict, but wouldn't leak Events then.

It's certainly true that Python has no way to know when a 
thread it didn't start goes away.
History
Date User Action Args
2007-08-23 14:28:38adminlinkissue1089632 messages
2007-08-23 14:28:38admincreate