many (dead?) threads appear in the debugger

cheops
2006-07-24
2013-03-15
  • cheops

    cheops - 2006-07-24

    running on windows xp
    python 2.4.3
    eclipse 3.2 + pydev 1.2.2 (just upgraded ;-)

    debugging the attached script results in an explosion of threads after a while.
    when suspending the debug-session I get the following in the console:
    ...
    could not find thread 10958000
    could not find thread 10958928
    could not find thread 10644272
    could not find thread 10645072
    could not find thread 10644080
    could not find thread 10642896
    could not find thread 10644464
    could not find thread 10645040
    ...

    I don't know for if this is the pydev debugger, or python itself that does not clean up the threads.
    If I run the program on the console and look at the amount of threads (probably only the running threads) in taskmanager, it is not growing.
    If you think this is a bug in pydev or python, I'll file it as such.

    import threading
    import time

    class Ping(threading.Thread):
        def __init__(self):
            threading.Thread.__init__(self)
           
            # self start the thread
            self.start()
       
        def run(self):
            time.sleep(0.1)

    def main():
        TASKS = 8

        while(True):
            getters = []
            for x in range(TASKS):
                getter = Ping()
                getters.append(getter)
           
            # wait for all the getters to finish
            for getter in getters:
                getter.join()
           

    if __name__ == "__main__":
        main()
       

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks