Add customizable per-platform affinity for content and pool threads
This commit is contained in:
@@ -129,17 +129,17 @@ bool ContentService::Init()
|
||||
LOG(Info, "Creating {0} content loading threads...", count);
|
||||
MainLoadThread = New<LoadingThread>();
|
||||
ThisLoadThread = MainLoadThread;
|
||||
LoadThreads.EnsureCapacity(count);
|
||||
LoadThreads.Resize(count);
|
||||
for (int32 i = 0; i < count; i++)
|
||||
{
|
||||
auto thread = New<LoadingThread>();
|
||||
LoadThreads[i] = thread;
|
||||
if (thread->Start(String::Format(TEXT("Load Thread {0}"), i)))
|
||||
{
|
||||
LOG(Fatal, "Cannot spawn content thread {0}/{1}", i, count);
|
||||
Delete(thread);
|
||||
return true;
|
||||
}
|
||||
LoadThreads.Add(thread);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -339,6 +339,9 @@ int32 LoadingThread::Run()
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#ifdef LOADING_THREAD_AFFINITY_MASK
|
||||
Platform::SetThreadAffinityMask(LOADING_THREAD_AFFINITY_MASK(LoadThreads.Find(this)));
|
||||
#endif
|
||||
|
||||
ContentLoadTask* task;
|
||||
ThisLoadThread = this;
|
||||
|
||||
Reference in New Issue
Block a user