Add ability to use more than one mempool iterator simultaneously.
This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).
Add a new parallel looper for MemPool items to BLI_task.
It merely uses the new thread-safe iterators system of mempool, quite
Note that unlike listbase case, here we can loop in a totally lock-free way,
we only need one memory barrier (and only when we have to get a new chuk to
Also added a basic gtest for this new feature.
BMesh: add limited support for parallelization over some basic iterators.
This merely uses new memloop/task looper over vertex/edge/face mempools.
As a demonstration, BM_mesh_normals_update was converted from OMP to
new code, basic test with heavily subdivided cube (24.5k faces) gives:
- old OMP code: average 10ms per run.
- new task code: average 6ms per run.
So new code seems to be easily 40% quicker, in addition to getting rid
of OMP. ;)