1. 注意: 导包是:
from multiprocessing.pool import ThreadPool #线程池不在thrading中
2. 代码:
from mutiprocessing.pool import ThreadPool
def func(*args,**kwargs):
print(args,kwargs)
pool = ThreadPool(4)
pool.apply_async(func,args = (1,2),kwds = {"name":'A'})
pool.close()
pool.join()
图例: