[Bf-blender-cvs] [8cffb0a141a] master: Task scheduler: Avoid over-allocation of tasks for parallel ranges

Sergey Sharybin noreply at git.blender.org
Tue Jan 9 16:11:53 CET 2018


Commit: 8cffb0a141af6dbfebc6917f2633ab92e26c4d8e
Author: Sergey Sharybin
Date:   Mon Jan 8 12:13:56 2018 +0100
Branches: master
https://developer.blender.org/rB8cffb0a141af6dbfebc6917f2633ab92e26c4d8e

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.

===================================================================

M	source/blender/blenlib/intern/task.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list