From 8cffb0a141af6dbfebc6917f2633ab92e26c4d8e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 8 Jan 2018 12:13:56 +0100 Subject: 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. --- source/blender/blenlib/intern/task.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '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; -- cgit v1.2.3