diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-03 20:24:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-03 20:44:29 +0300 |
commit | e43b74d87a43ab919b86434db9881608c5b9f762 (patch) | |
tree | 3e885e7530db301a26d68a632147b36925855bc4 /source/blender/blenlib/BLI_task.h | |
parent | 4b3f1b7540c43999b94c5147eabd6b0b7a6693f8 (diff) |
Optimization of parallel range
It now supports different scheduling schemas: dynamic and static.
Static one is the default and it splits work into equal number of
range iterations.
Dynamic one allocates chunks of 32 iterations which then being
dynamically send to a thread which is currently idling.
This gives slightly better performance. Still some tricks are
possible to have. For example we can use some smarter static scheduling
when one thread might steal tasks from another threads when it runs
out of work to be done.
Also removed unneeded spin lock in the mesh deform evaluation,
on the first glance it seemed to be a reduction involved here but
int fact threads are just adding value to the original vertex
coordinates. No write access to the same element of vertexCos
happens from separate threads.
Diffstat (limited to 'source/blender/blenlib/BLI_task.h')
-rw-r--r-- | source/blender/blenlib/BLI_task.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h index 8c22a25fe14..28da673ea97 100644 --- a/source/blender/blenlib/BLI_task.h +++ b/source/blender/blenlib/BLI_task.h @@ -106,7 +106,8 @@ void BLI_task_parallel_range_ex( int start, int stop, void *userdata, TaskParallelRangeFunc func, - const int range_threshold); + const int range_threshold, + const bool use_dynamic_scheduling); void BLI_task_parallel_range( int start, int stop, void *userdata, |