Python threading and GUIs

David LeBlanc whisper at oz.net
Fri Aug 2 19:42:43 CEST 2002


A GUI uses a 'message pump' to receive and dispatch messages/events to it's
widgets. With 2 message pumps in the same process, one pump gets all the
messages and either processes or throws away messages that it doesn't
understand - the other one(s) starves. If they both happen to run, they'll
be stealing messages from each other and neither will run properly.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of John J Breen
> Sent: Friday, August 02, 2002 9:18
> To: python-list at python.org
> Subject: Python threading and GUIs
>
>
>     Hey,
>         Concerning threading in python I am trying to run two
> GUI components with TK and GTK. I want them to communicate so I was
> thinking of running the Tk mainloop in one thread and the GTK mainloop
> in another. Can I not do this? Only the first thread that I start
> actually runs and the second thread with the second GUI calls just seems
> to be ignored.
>
> Thanks
> John
>
> --
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list