Chapter 13. Asynchronous Programming with Thread and Queue
Many times, code that works flawlessly in the simplicity of a test environment encounters problems in the real world; unfortunately, this seems to be the case for your application. While your network functions ran instantaneously in your localhost-only test environment, the lab's slow VPN uplink has exposed some shortcomings in your programming. Users report that the application freezes or becomes unresponsive when network transactions are taking place. Although it does work, it looks unprofessional and is an annoyance to users.
To solve this problem, we're going to learn about the following topics:
- How to control Tkinter's event queue
- How to write multithreaded applications using Python's
threading
module - How to pass messages between threads using queues