mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 03:35:19 +02:00
Change the policy for number of threads
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <cstdio>
|
||||
#include <algorithm>
|
||||
#include <thread>
|
||||
#include <deque>
|
||||
#include <condition_variable>
|
||||
@@ -121,7 +122,10 @@ void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task, TaskType task
|
||||
}
|
||||
|
||||
int ThreadManager::GetNumLooperThreads() const {
|
||||
return (int)(global_->threads_.size() / 2);
|
||||
// If possible, let's use all threads but one for parallel loops.
|
||||
// Not sure what's the best policy here. Maybe we should just have more threads than CPUs.
|
||||
int numLooperThreads = (int)(global_->threads_.size()) - 1;
|
||||
return std::max(numLooperThreads, 1);
|
||||
}
|
||||
|
||||
void ThreadManager::TryCancelTask(uint64_t taskID) {
|
||||
|
||||
Reference in New Issue
Block a user