Deadlocking IDLE under Win32

James "Wez" Weatherall jnw22 at cam.ac.uk
Tue Apr 11 06:22:47 EDT 2000


I've noticed a bug with which a simple multithreaded test program such as:

import threading

class MyThread(threading.Thread):
    def run(self):
        while self.a < 1000:
            print self.a,
            self.a=self.a+2

thread1=MyThread()
thread2=MyThread()
thread1.a, thread2.a = 0, 1
thread1.start()
thread2.start()

This program will print out about twenty numbers and then hang the whole
interpreter if you run it from IDLE but it runs fine from the command-line
version, suggesting some locking problem in the Tk-based print command.

Does anyone have any ideas about this?

Cheers,

--
James "Wez" Weatherall






More information about the Python-list mailing list