Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-08 14:13:56 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-09 18:09:33 +0300
commit8cffb0a141af6dbfebc6917f2633ab92e26c4d8e (patch)
tree475a614af44173ccd3914bb43076004b37627a65 /source/blender/blenlib/intern/task.c
parentc4e42d70a4949352f1233574cfc2da30c097439d (diff)
Task scheduler: Avoid over-allocation of tasks for parallel ranges
This seems to only cause extra rthreading overhead on systems with 10s of threads, without actually solving anything.
Diffstat (limited to 'source/blender/blenlib/intern/task.c')
-rw-r--r--source/blender/blenlib/intern/task.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index ba600be870b..8c83fcabf79 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -1104,7 +1104,7 @@ void BLI_task_parallel_range(int start, int stop,
* and instead have tasks which are evenly distributed across CPU cores and
* pull next iter to be crunched using the queue.
*/
- num_tasks = num_threads * 2;
+ num_tasks = num_threads + 2;
state.start = start;
state.stop = stop;
@@ -1257,7 +1257,7 @@ void BLI_task_parallel_listbase(
* and instead have tasks which are evenly distributed across CPU cores and
* pull next iter to be crunched using the queue.
*/
- num_tasks = num_threads * 2;
+ num_tasks = num_threads + 2;
state.index = 0;
state.link = listbase->first;
@@ -1345,7 +1345,7 @@ void BLI_task_parallel_mempool(
* and instead have tasks which are evenly distributed across CPU cores and
* pull next item to be crunched using the threaded-aware BLI_mempool_iter.
*/
- num_tasks = num_threads * 2;
+ num_tasks = num_threads + 2;
state.userdata = userdata;
state.func = func;