preforkjava.py 文件源码

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

项目:SoCFoundationFlow 作者: mattaw 项目源码 文件源码
def init_task_pool(self):
        # lazy creation, and set a common pool for all task consumers
        pool = self.pool = []
        for i in range(self.numjobs):
            consumer = Runner.get_pool()
            pool.append(consumer)
            consumer.idx = i
        self.ready = Queue(0)
        def setq(consumer):
            consumer.ready = self.ready
            try:
                threading.current_thread().idx = consumer.idx
            except Exception as e:
                print(e)
        for x in pool:
            x.ready.put(setq)
        return pool
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号