Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-11-06 17:04:47 +0300
committerJacques Lucke <jacques@blender.org>2022-11-06 17:07:32 +0300
commitc29c61f840aa317a6dd887a35fffbc60a78d87a9 (patch)
treeb76bc48a047f6272386770ba99dcfd895fbb420b /source/blender/blenlib/BLI_task.hh
parentf4e97bd67d9774433c2bb870126cc8689045f93a (diff)
Fix T102292: deadlock in geometry nodes evaluation with task isolation
As described in the comment on `BLI_task_isolate`, deadlocks can happen when isolation is used with threading primitives that separate spawning tasks from executing them. All threads are waiting the tasks to complete but no thread is able to continue working due to task isolation. The fix is to not pass lazy-threading hints through task isolations. This way isolated regions can't create new tasks in a scheduler further up the call stack. This may lead to minor slowdowns because less threading may be used. It's generally possible to get rid of the slowdown again by sending the lazy-threading hint before entering the isolated region.
Diffstat (limited to 'source/blender/blenlib/BLI_task.hh')
-rw-r--r--source/blender/blenlib/BLI_task.hh1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_task.hh b/source/blender/blenlib/BLI_task.hh
index 9f9a57be634..e7d9a21439a 100644
--- a/source/blender/blenlib/BLI_task.hh
+++ b/source/blender/blenlib/BLI_task.hh
@@ -129,6 +129,7 @@ void parallel_invoke(const bool use_threading, Functions &&...functions)
template<typename Function> void isolate_task(const Function &function)
{
#ifdef WITH_TBB
+ lazy_threading::ReceiverIsolation isolation;
tbb::this_task_arena::isolate(function);
#else
function();