Wed, 05/29/2024 - 12:35
Hello everyone,
I'm trying to do overlap detections on 3D models utilizing BRepAlgoAPI_Common with OpenCascade 7.8.1.
To enhance efficiency, I've ventured into running these computations within a multithreaded environment.
Rather than utilizing SetRunParallel to process a single BRepAlgoAPI_Common in multiple threads, I've opted for employing numerous BRepAlgoAPI_Common within each thread.
To ensure data integrity, I've encapsulated my TopoDS_Shapes within mutexes to prevent concurrent access.
However, I've encountered crashes with certain models. I've attempted to protect the TopoDS_TShape instead of the TopoDS_Shapes, yet the crashes persist.
Is BRepAlgoAPI_Common inherently thread-safe, or are there known challenges when employing it within a multithreaded context ?
Thank you!
Best Regards
Charles Meyer
Wed, 05/29/2024 - 13:22
Hello, if operation take impact on original Face, for sure, it will be data raysing.
For avoid that you need to make deep clone original shape. And after that match before/after with ReShape and history of clone operation.
Best regards, Dmitrii.
Wed, 05/29/2024 - 15:33
Hello Dmitrii,
Thank you for your quick answer.
I tried to make deep clone with BRepBuilderAPI_Copy but i still got the crash.
Is that the good way to deep clone a shape ?
Thanks
Wed, 05/29/2024 - 19:00
It is only one way if you have no option to control data sharing behavior.
I have no idea why you have crash... Do you copy geometry too? Which level you split your common operation? Face level? Solid level?
Best regards, Dmitrii.
Thu, 05/30/2024 - 09:49
I am copying the shape at the solid level.
Is there a specific detail or subtlety we might be missing that could explain why the crash is still occurring?
Thanks again for your help.
Best regards,
Charles Meyer
Thu, 05/30/2024 - 10:09
When you using copy tool. BRepBuilderAPI_Copy you need to specificy any arguments to true.
Best regards, Dmitrii.
Fri, 05/31/2024 - 12:25
It turns out that my issue was due to having compiled OCCT with the BUILD_RELEASE_DISABLE_EXCEPTIONS flag set to ON.
After recompiling with this flag set to OFF, I no longer experience crashes.
Thanks again for your help.
Best regards, Charles Meyer