mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 19:58:36 +01:00
Common: Set a min size on threadpool work chunks.
This should avoid slicing loops, etc. into too many chunks. Generalize the memcpy a bit.
This commit is contained in:
1 parent
639dd67130
commit
b2f3f06768
5 files changed
+48
-45
No files matched your search
@@ -6,9 +6,14 @@
|
||||
std::unique_ptr<ThreadPool> GlobalThreadPool::pool;
|
||||
std::once_flag GlobalThreadPool::init_flag;
|
||||
|
||||
void GlobalThreadPool::Loop(const std::function<void(int,int)>& loop, int lower, int upper) {
|
||||
void GlobalThreadPool::Loop(const std::function<void(int,int)>& loop, int lower, int upper, int minSize) {
|
||||
std::call_once(init_flag, Inititialize);
|
||||
pool->ParallelLoop(loop, lower, upper);
|
||||
pool->ParallelLoop(loop, lower, upper, minSize);
|
||||
}
|
||||
|
||||
void GlobalThreadPool::Memcpy(void *dest, const void *src, int size) {
|
||||
std::call_once(init_flag, Inititialize);
|
||||
pool->ParallelMemcpy(dest, src, size);
|
||||
}
|
||||
|
||||
void GlobalThreadPool::Inititialize() {
|
||||
|
||||
Reference in new issue
Block a user