parallel_loop.py 文件源码

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

项目:picire 作者: renatahodovan 项目源码 文件源码
def _body(self, i, target, args):
        """
        Executes the given function in its own process group (on Windows: in
        its own process).

        :param i: The index of the current configuration.
        :param target: The function to run in parallel.
        :param args: The arguments that the target should run with.
        """
        if not is_windows:
            os.setpgrp()

        try:
            if not target(*args):
                self._break.value = 1
        except:
            logger.warning('', exc_info=True)
            self._break.value = 1

        self._slots[i] = 0

        with self._lock:
            self._lock.notify()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号