fix: use condition variables instead of busy waits in worker threads

Resolves: NEO-16085, GSD-11678, HSD-14025819208

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2025-09-23 12:24:40 +00:00
committed by Compute-Runtime-Automation
parent 49293fcac6
commit 452475a0b9
18 changed files with 218 additions and 67 deletions

View File

@@ -138,7 +138,8 @@ SubmissionStatus CommandStreamReceiver::submitBatchBuffer(BatchBuffer &batchBuff
if (!isUpdateTagFromWaitEnabled()) {
this->latestFlushedTaskCount = taskCount + 1;
}
taskCount++;
incrementTaskCountAndNotifyNewSubmission();
return retVal;
}
@@ -1263,5 +1264,17 @@ void CommandStreamReceiver::addToEvictionContainer(GraphicsAllocation &gfxAlloca
this->getEvictionAllocations().push_back(&gfxAllocation);
}
void CommandStreamReceiver::incrementTaskCountAndNotifyNewSubmission() {
++taskCount;
notifyNewSubmission();
}
void CommandStreamReceiver::notifyNewSubmission() {
if (directSubmissionControllerSyncData) {
std::lock_guard<std::mutex> lock(directSubmissionControllerSyncData->mutex);
directSubmissionControllerSyncData->condVar.notify_one();
}
}
std::function<void()> CommandStreamReceiver::debugConfirmationFunction = []() { std::cin.get(); };
} // namespace NEO