摘要: 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... 阅读全文
posted @ 2018-05-07 15:01 阜阳小全 阅读(86) 评论(0) 推荐(0) 编辑
摘要: import time,random import queue,threading q = queue.Queue() def Producer(name): count = 0 while count < 10: print('making-------------') time.sleep(random.randrange(3)) ... 阅读全文
posted @ 2018-05-07 07:34 阜阳小全 阅读(98) 评论(0) 推荐(0) 编辑