摘要:
import threading from atexit import register from random import randrange from threading import Thread, Lock from time import sleep, ctime lock = Lock 阅读全文
摘要:
import threading from time import ctime,sleep class MyThread(threading.Thread): """自定义多线程类""" def __init__(self,func,args,name=''): threading.Thread._ 阅读全文
摘要:
def diaodu(time,m): """将各个任务分配到m台机器上,任务花费时间列表已汇总至time中,返回分配后的最小时间""" tmp=[0 for _ in range(m)] #初始化每个机器上花费的时间为0 if len(time)<=m: #如果任务数小于等于机器数,就每个任务分配 阅读全文