摘要:
import time from multiprocessing import Process,Pool def Foo(i): time.sleep(1) print(i) def Bar(arg): print('hello') if __name__ == '__main__': pool = Pool(5) #进程池的容量是5 for i... 阅读全文
摘要:
import time,random import queue,threading q = queue.Queue() def Producer(name): count = 0 while count < 10: print('making-------------') time.sleep(random.randrange(3)) ... 阅读全文