守护进程:
伴随父进程的生命周期终结而终结的进程
def func1(): print('func1') def func2(): print('func2') if __name__ == '__main__': from multiprocessing import Process p1 = Process(target=func1) p2 = Process(target=func2) p1.daemon = True p1.start() p2.start() print('master over') #master over p1伴随父进程的终结而终结,基本是没有开始运行就结束了 #func2