hhsearch.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CSB 作者: csb-toolbox 项目源码 文件源码
def runmany(self, contexts, workers=mp.cpu_count(), cpu=1):

        if workers > len(contexts):
            workers = len(contexts)

        results = []
        taskargs = [(self.program, self.db, cpu, c) for c in contexts]

        pool = mp.Pool(workers)

        try:
            for c in pool.map(_task, taskargs):
                results.append(c)
        except KeyboardInterrupt:
            pass
        finally:
            pool.terminate()

        return results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号