fixed and improved

This commit is contained in:
2023-12-05 16:03:42 +03:00
parent 0bd2d3fe36
commit 5e229fcb68
5 changed files with 34 additions and 20 deletions

View File

@@ -124,9 +124,13 @@ public:
Utils::Mkdir(pathRes);
string buf;
vector<int> emptyKeys;
vector<T*> toDel;
while (activeTasks) {
long oldActiveTasks = activeTasks;
vector<int> emptyKeys;
emptyKeys.clear();
toDel.clear();
//ставим задачи от больших к меньшему по ядрам
for (auto& elem : sortedByKernelNeeds) {
@@ -156,8 +160,7 @@ public:
// очищаем от пустых ключей
for (auto& empty : emptyKeys)
sortedByKernelNeeds.erase(empty);
vector<T*> toDel;
// проверяем нет ли завершившихся задач
for (auto& task : activeTaskSet)
{
@@ -173,6 +176,7 @@ public:
}
}
// очищаем завершенные задачи
for (auto& del : toDel)
activeTaskSet.erase(del);
@@ -182,7 +186,7 @@ public:
changeState();
String outFile(pathRes + "/"+getStatePrefix()+"Info.txt");
String outFile(pathRes + "/" + getStatePrefix() + "Info.txt");
File tmp(outFile, String(buf.c_str()));
}
void saveState() {