void CRUDependenceGraph::ScheduleDoomedTask() { CRUTask *pTask; CRUTopologicalDGIterator it(*this, CRUTopologicalDGIterator::DIRECT); for (; (pTask = it.GetCurrentTask()) != NULL; it.Next()) { if (0 != pTask->GetStatus()) { pScheduledTask_ = pTask; return; } } }
void CRUTask::HandlePredecessorFailure(CRUTask &task) { RUASSERT (0 != task.GetStatus()); // If there is already something wrong, don't touch me if (0 != this->GetStatus()) { return; } // The error's text will be printed only for the Refresh tasks. CRUException &ex = GetErrorDesc(); ex.SetError(IDS_RU_TASK_PREDECESSOR_PROBLEM); ex.AddArgument(this->GetTaskName()); ex.AddArgument(task.GetTaskName()); }
void CRUDependenceGraph::ScheduleNormalTask() { ComputeGainFunction(); CRUTopologicalDGIterator it(*this, CRUTopologicalDGIterator::DIRECT); CRUTask *pTask; for (; (pTask = it.GetCurrentTask()) != NULL; it.Next()) { RUASSERT (0 == pTask->GetStatus()); // Consider only ready tasks that are not being executed already if (FALSE == pTask->IsReady() || TRUE == pTask->IsRunning()) { continue; } // Examine the task's candidateship ... ConsiderTaskForScheduling(pTask); } }