When to call thread.join in a GUI application

前端 未结 1 783
谎友^
谎友^ 2021-01-25 05:38
import wx
import json
import queue
from collections import namedtuple
import threading


class MyDialog(wx.Frame):

    def __init__(self, parent, title):
        self.n         


        
相关标签:
1条回答
  • 2021-01-25 06:40

    It is perfectly ok to not call join() if you don't need its functionality to wait for the thread to finish.

    By the way: In the main thread of a GUI application (the thread automatically created at start in which all GUI things happen) it is bad practice to call any function that sleeps or waits for anything as the GUI doesn't react (freezes) while waiting.

    0 讨论(0)
提交回复
热议问题