Blender Git Loki

Git Commits -> Revision 7a4252d

Revision 7a4252d by Brecht Van Lommel (soc-2021-curves)
June 21, 2021, 14:31 (GMT)
BLI: use explicit task isolation, no longer part of parallel operations

After looking into task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Sprite Fright
file involving motion blur renders.

There is no apparent place where we adding or waiting on tasks in a task group
from different isolation regions, which is what is known to cause problems. Yet
it still hangs. Either we do not understand some limitation of TBB isolation,
or there is a bug in TBB, but we could not figure it out.

Instead the idea is to use isolation only where we know we need it: when
holding a mutex lock and then doing some multithreaded operation within that
locked region. Three places where we do this now:
* Generated images
* Cached BVH tree building
* OpenVDB lazy grid loading

Compared to the more automatic approach previously used, there is the downside
that it is easy to miss places where we need isolation. Yet doing it more
automatically is also causing unexpected issue and bugs that we found no
solution for, so this seems better.

Patch implemented by Sergey and me.

Differential Revision: https://developer.blender.org/D11603

Commit Details:

Full Hash: 7a4252d461779f7e7198e573c1a431a1b56d9c9a
Parent Commit: 8e0fe74
Committed By: Dilith Jayakody
Lines Changed: +180, -168

29 Modified Paths:

/intern/cycles/blender/blender_python.cpp (+5, -7) (Diff)
/source/blender/blenkernel/intern/bvhutils.c (+37, -9) (Diff)
/source/blender/blenkernel/intern/editmesh_tangent.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/image.c (+44, -11) (Diff)
/source/blender/blenkernel/intern/lib_override.c (+1, -2) (Diff)
/source/blender/blenkernel/intern/mesh_evaluate.c (+1, -2) (Diff)
/source/blender/blenkernel/intern/mesh_tangent.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/ocean.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/particle.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/particle_distribute.c (+1, -1) (Diff)
/source/blender/blenkernel/intern/volume.cc (+14, -9) (Diff)
/source/blender/blenlib/BLI_task.h (+33, -43) (Diff)
/source/blender/blenlib/intern/task_graph.cc (+1, -1) (Diff)
/source/blender/blenlib/intern/task_iterator.c (+2, -2) (Diff)
/source/blender/blenlib/intern/task_pool.cc (+9, -54) (Diff)
/source/blender/blenlib/intern/task_range.cc (+5, -7) (Diff)
/source/blender/blenlib/intern/task_scheduler.cc (+10, -0) (Diff)
/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc (+1, -1) (Diff)
/source/blender/compositor/intern/COM_WorkScheduler.cc (+1, -2) (Diff)
/source/blender/depsgraph/intern/eval/deg_eval.cc (+1, -2) (Diff)
/source/blender/editors/mesh/editmesh_undo.c (+1, -1) (Diff)
/source/blender/editors/render/render_opengl.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+1, -1) (Diff)
/source/blender/editors/space_clip/clip_editor.c (+1, -1) (Diff)
/source/blender/editors/space_clip/clip_ops.c (+1, -1) (Diff)
/source/blender/editors/space_file/filelist.c (+1, -2) (Diff)
/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c (+2, -2) (Diff)
/source/blender/imbuf/intern/imageprocess.c (+1, -1) (Diff)
/source/blender/modifiers/intern/MOD_nodes_evaluator.cc (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021