1
有些主机可以在locations.get(i)中执行任务。 为了在它们之间调度任务,首先我寻找空闲主机,如果有空闲主机,我发送task
到最快的主机。 但是如果没有空闲的主机,这个算法开始挂起。我该如何解决它?SimGrid。没有空闲主机时发现无限循环
for (int i = 0; i < taskCount; i++){
while (true) {
ArrayList<Host> hostList = getFreeHost(locations.get(i));
if (!hostList.isEmpty()){
Host destination = getFastestHost(hostList);
InstructionTask instructionTask = new InstructionTask(taskName.get(i), compSize.get(i), commSize.get(i), destination.getName());
instructionTask.send(destination.getName());
break;
}
}
}
你是我的英雄! –