守护进程的应用场景
import time import random from multiprocessing import Process,JoinableQueue def consumer(name,q): while True: res=q.get() if res is None:break time.sleep(random.randint(1,3)) print('
import time import random from multiprocessing import Process,JoinableQueue def consumer(name,q): while True: res=q.get() if res is None:break time.sleep(random.randint(1,3)) print('