JuliaGeometry / Triangulate.jl

Julia Wrapper for the Triangle Mesh Generator
MIT License
38 stars 11 forks source link

Thread safety #17

Open j-fu opened 1 year ago

j-fu commented 1 year ago

When using the unsuitable callback, the unsuitable method is passed to C through a global variable. Therefore at least in this case, the code is not thread-safe. It should be thread-safe (not tested though) if -u is not used.

For making the code thread-safe, the unsuitable callback should be made part of TriangulateIO in the C library after checking if this is possible withot mayor modification of triangle.c .

Meanwhile the advise is to put a lock around triangulate calls in multithreaded code.