How to use two threads (GUI and backend)

Marko Rauhamaa marko at pacujo.net
Wed Oct 26 09:02:46 EDT 2016


pozz <pozzugno at gmail.com>:

> The real problem is that retrieving status from remote device is a
> slow operation. If the GUI thread blocks waiting for the answer, the
> GUI blocks and the user complains.

Correct. Obnoxious, blocking APIs abound.

However, I have usually used processes (instead of threads) to
encapsulate blocking APIs. Processes have neater resource isolation and
a better-behaving life cycle. For example, you can actually kill a
process while you can't kill a thread.


Marko



More information about the Python-list mailing list