from multiprocessing import Process,Queue import time def write(q): for i in range(1000000000): q.put(i) # time.sleep(1) print(q) def read(q): while True: i=q.get() print(i,‘read‘) if __name__ == ‘__main__‘: q=Queue(10000) wp=Process(target=write,args=(q,)) rp=Process(target=read,args=(q,)) wp.start() rp.start() rp.join()