Tkinter application 'freezes' while continually polling Pipe for contents (multiprocessing)

后端 未结 4 585
北荒
北荒 2021-01-27 09:21

I have two scripts:

Processor_child.py: Its purpose is to perform a number of data analysis and cleaning operations. This must perform the same operatio

4条回答
  •  旧时难觅i
    2021-01-27 09:38

    Your Connection.poll() call is busy-waiting and chewing through the CPU. But note that Connection objects have a fileno() method; this means you can use select/poll calls to put your process to sleep while waiting for them to become ready for I/O. Note that the tkinter event loop supports file handlers to allow you to do this without blocking the UI.

提交回复
热议问题