After looking into the task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Spring file
involving motion blur renders.
There is no apparent place where we adding/execution tasks to a task group from
different isolation regions, yet it still hangs. Either we do not understand some
limitation of TBB isolation, or there is a bug in TBB.
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
If anyone can think of more places, please let us know.
Compared to the more automatic approach previously used, there is of course 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.
This patch would make D11531 obsolete.
