tkinter & threads

Guido van Rossum guido at cnri.reston.va.us
Thu Sep 2 08:28:53 EDT 1999


Robin Becker <robin at jessikat.demon.co.uk> writes:

> Is Tkinter thread safe? I looked at Guido's brownian demo and there are
> no special precautions about locking the canvas. Also I believe there is
> some restriction on which thread Tk can live in.

This is a 1.5.2 feature; I added enough locks to _tkinter to make it
thread-safe.  However on Windows there are still problems (you can
only call update() and friends from the main thread) and I think I've
seen one report from non-Windows where things broke under certain
circumstances.  The Brownian demo is there specifically to show that
Tkinter is now thread-safe.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list