Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Straight Skeleton - Thread Safe

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Straight Skeleton - Thread Safe


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Straight Skeleton - Thread Safe
  • Date: Fri, 10 Jul 2015 10:52:33 +0200 (CEST)

On Fri, 10 Jul 2015, Marcel wrote:

i have some trouble with your Straight Skeleton implementation. I call
several independent instances of the straight skeleton implementation in
parallel. Unfortunately, with a parallel execution, my program crashes
with a segmentation fault, double free or corruption or similar errors.
My code basically looks like the following.

######
using CGAL;
typedef Simple_cartesian<Gmpq> Kernel;

Can you try with mpq_class instead of Gmpq?

std::vector<Polygon_2<Kernel>> polygons; // non empty set of polygons ;)

Can the different polygons have some point coordinates in common?

#pragma omp parallel for
for (size_t i = 0; i < polygons.size(); ++i) {
auto skeleton =
create_interior_straight_skeleton_2<Polygon_2<Kernel>,
Kernel>(polygons[i],c);
}
######

A serial execution of my code works flawlessly. Thus, putting the
straight skeleton computation in a critical section works as well. I've
tried to define the CGAL_HAS_THREADS macro but as far as I can tell,
this has no effect. I have incorporated the patch presented in [1] but
this does not work as well (Note that I am using CGAL 4.6.1).

Hmm, if you tried that patch then it is probably not the issue I was thinking about, but it is still useful to check.

Is this a known issue? Is there a work around?

--
Marc Glisse



Archive powered by MHonArc 2.6.18.

Top of Page