from multiprocessing.dummy import Pool as ThreadPool
def fun():
#功能处理函数
return 0
#待处理的目标对象
items = ['apple', 'bananan', 'cake', 'dumpling']
pool = ThreadPool()
pool.map(fun, items)
pool.close()
pool.join()
from multiprocessing.dummy import Pool as ThreadPool
def fun():
#功能处理函数
return 0
#待处理的目标对象
items = ['apple', 'bananan', 'cake', 'dumpling']
pool = ThreadPool()
pool.map(fun, items)
pool.close()
pool.join()