Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Multithreading and do_intersect(..)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Multithreading and do_intersect(..)


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Multithreading and do_intersect(..)
  • Date: Sun, 29 Jan 2012 10:08:34 +0100 (CET)

On Sun, 29 Jan 2012, Bernhard Kornberger wrote:

I use CGAL 3.9 and my multithreaded code fails occasionally. Now I'd
like to ask if the respective part of CGAL is thread safe? Here is a
code snippet:

***
#define CGAL_HAS_THREADS
typedef CGAL::Exact_predicates_exact_constructions_kernel K;

class ESegment_3 : public K::Segment_3
{
...
}

EPoint_3* ESegment_3::splitLowPoint(const K::Line_3& axLin)
{
if(CGAL::do_intersect(*this,axLin)) // Line 582
{
}
}
***

There are 8 std::vector<ESegment*>, and they are treated by 8
separate threads. Each ESegment is unique. Here is a backtrace,
created with gdb:

If no object is accessed from 2 different threads, you should be fine...
(by the way, it looks like you are profiling your code, which doesn't always work great with multiple threads)

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page