Threads -- play well with others? If not, what instead?

Moshe Zadka moshez at math.huji.ac.il
Tue Jun 13 00:26:27 EDT 2000


On Mon, 12 Jun 2000, Russell E. Owen wrote:

> David Beazley's excellent "Python Essential Reference" says in the 
> section on threads: "In addition, many of Python's most popular 
> extensions such as Tkinter may not work properly in a threaded 
> environment."
> 
> I assume it's true, but it was quite a bombshell. I was hoping to write 
> a networked GUI client, hence:
> - read data from a socket and fill in a GUI display
> - accept input from the user and write data to the socket
> I assumed I'd use two threads, one for input, one for output. Now I have 
> no idea what to do. Any suggestions?

Yes. Use event based programming. Tcl has support for fileevents -- events
that get called when a file is ready to read from.

--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list