def run_tp(n, body):
"""ThreadPool.map"""
from multiprocessing.pool import ThreadPool
global reused_pool, numthreads
if 'reused_pool' not in globals():
log.debug("Creating ThreadPool(%s)" % numthreads)
reused_pool = ThreadPool(int(numthreads))
reused_pool.map(body, n)
评论列表
文章目录