python的多线程
程序员文章站
2024-03-23 18:24:28
...
from multiprocessing.dummy import Pool
def A(a):
pass
B = [a,b,c]
pool = Pool(6) #启动6个线程
pool.map(A,B)
pool.close()
pool.join() #等线程都结束后在执行主程序