So I found this code while debugging a stall we’re getting in our app. In TaskGraph.cpp I find:
virtual void TriggerEventWhenTasksComplete(FEvent* InEvent, const FGraphEventArray& Tasks, ENamedThreads::Type CurrentThreadIfKnown = ENamedThreads::AnyThread) final override
{
check(InEvent);
bool bAnyPending = true;
if (Tasks.Num() > 8) // don't bother to check for completion if there are lots of prereqs...too expensive to check
{
bAnyPending = false;
for (int32 Index = 0; Index < Tasks.Num(); Index++)
{
if (!Tasks[Index]->IsComplete())
{
bAnyPending = true;
break;
}
}
}
.
.
.
}
----------------------------------------
This line:
if (Tasks.Num() > 8) // don't bother to check for completion if there are lots of prereqs...too expensive to check
Is either backwards and should be a < 8, or the comment is wrong. Because as I read the code, they DO the test when the number of prereq tasks is > 8 (i.e. large) and DONT do the test when it would be cheap. Or am I missing something here?