Deadlocking IDLE under Win32
mhammond at skippinet.com.au
Wed Apr 12 02:19:20 CEST 2000
My guess is that the "print" under IDLE is not thread-safe. Change the
program to not print (or to append items to a queue, which the main thread
then prints) and see if this is the problem.
If so, consider submitting a patch to IDLE. In Pythonwin, the
sys.stdout.write function checks if it is the main thread, and if not
simply queues the output (module Queue) for the main thread to print.
[This may also explain why I see the threading test hang when running the
Python test suite under IDLE]
"James "Wez" Weatherall" <jnw22 at cam.ac.uk> wrote in message
news:8cuudo$8pj$1 at pegasus.csx.cam.ac.uk...
> I've noticed a bug with which a simple multithreaded test program such
> import threading
> class MyThread(threading.Thread):
> def run(self):
> while self.a < 1000:
> print self.a,
> thread1.a, thread2.a = 0, 1
> 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
> version, suggesting some locking problem in the Tk-based print command.
> Does anyone have any ideas about this?
> James "Wez" Weatherall
More information about the Python-list