标签:call bsp code join() div 回调函数 syn imp multi
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 in range(100): pool.apply_async(func=Foo,args=(i,),callback=Bar) #callback是回调函数 pool.close() pool.join() print(‘end---‘)
标签:call bsp code join() div 回调函数 syn imp multi
原文地址:https://www.cnblogs.com/lhqlhq/p/9002780.html