mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Change the policy for number of threads
This commit is contained in:
1 parent
5fd15c06a3
commit
a9e9929a72
1 file changed
+5
-1
@@ -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