process.py 文件源码

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

项目:AutoML-Challenge 作者: postech-mlg-exbrain 项目源码 文件源码
def handle_tasks(tasks, time_limit, memory_limit, n_jobs=1, logger=None):
    window = []
    while len(tasks) > 0:
        while len(window) < n_jobs:
            if len(tasks) == 0:
                break
            job, sema = tasks.pop()
            window.append((job, time.time(), sema))
            job.start()
            if logger:
                logger.debug("Process %s start: %s MB is used" % (job.pid, memory_usage()))

        while len(window) == n_jobs:
            window = _check_window(window, time_limit, memory_limit, logger)

    while len(window) > 0:
        window = _check_window(window, time_limit, memory_limit, logger)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号