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('