-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Concurrently readable lazy-evaluated number type in CGAL #4340
Description
Hello, does CGAL provide a working (maybe experimental?) lazy-evaluated number type that allows concurrent read operations? I asked this question in libigl/libigl#1339 and it seems that I'm not the only one with this requirement.
The program I'm working on could benefit from parallelization (potentially a 2x speedup), but when using Kernel<CGAL::Lazy_exact_nt> or CGAL::Epeck, I've noticed that concurrent read operations cause data races and crash the program.
I've tried using the number type mpq_class (as mentioned in #2685), which does not use lazy evaluation nor reference counting. As a result, the program runs without data races, but much slower.
I've also tried cloning Laurent Rineau's branch implementing Thread_safe_epeck (https://github.com/lrineau/cgal/tree/Filtered_kernel-Epeck_reentrance-GF). The code does compile and it seems that for simple inputs everything works perfectly. However, when I tried to process slightly bigger inputs (~3000 vertices), the program will sometimes crash. Is this a known issue? Maybe I'm doing something wrong - I could elaborate in another issue if that would be appropriate. Anyway, I want to thank Laurent for his effort in implementing a thread-safe epeck, I very much appreciate the work.