Thread safety of OCC?

I'm running operations like BRepMesh_IncrementalMesh on different shapes from different threads simultaneously, and occasionally getting access violation exceptions when doing so; said errors don't happen often and don't seem to over occur when I use only one thread to call said functions, which leads me to believe that I'm encountering some sort of race condition within OCC code. I have already experimented with turning the memory manager off, and turning it on but with re-entrant mode on; the same problems persist no matter what settings I use.

I should note all the shapes are from the same file when this occurs, if that makes any difference e.g. if a shared edge might be causing the issue. Is there any documentation on which functions are thread-safe in OCC 6.6.0?

Cauchy Ding's picture

In my app, I also use BRepMesh_IncrementalMesh to tessellate shapes using multi-threads and no exception found yet.
But when I use BRepOffsetAPI_MakeFilling to create lots of surfaces from edges using multi-threads, it always cause crash.
So I guess BRepOffsetAPI_MakeFilling is not thread-safe.