Subject: CGAL users discussion list
List archive
- From: Marc Glisse <>
- To:
- Subject: Re: [cgal-discuss] Multithreading and do_intersect(..)
- Date: Sun, 29 Jan 2012 15:03:11 +0100 (CET)
On Sun, 29 Jan 2012, Bernhard Kornberger wrote:
Thank you for the valuable hint regarding profiling. However,
multithreading still doesn't work reliably. So I have one more
question. Let's create segments like this:
***
#define CGAL_HAS_THREADS
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
K::Point_3 a(0,0,0);
K::Point_3 b(1,0,0);
K::Point_3 c(0,1,0);
K::Segment_3 s0(a,b);
K::Segment_3 s1(a,c);
***
Are s0 and s1 independent so that they can be treated by different
threads? Or does the reference counting of Gmpq some magic behind
the scenes that links the segments to the same point?
Note that I haven't looked in details, this is just a quick guess.
What you get in a, b and c are lazy point constructors.
What you get in s0 and s1 are lazy segment constructors. They both keep a reference to 'a' lying around, which at some point they may even modify through update_exact. So I would say the objects are not independent.
Maybe something like Simple_cartesian<mpq_class>, possibly with some filtering on top for speed, would be happy with this code. Otherwise, you may have to rewrite a bit to make sure the objects really are independent.
--
Marc Glisse
- [cgal-discuss] Multithreading and do_intersect(..), Bernhard Kornberger, 01/29/2012
- Re: [cgal-discuss] Multithreading and do_intersect(..), Marc Glisse, 01/29/2012
- Re: [cgal-discuss] Multithreading and do_intersect(..), Bernhard Kornberger, 01/29/2012
- Re: [cgal-discuss] Multithreading and do_intersect(..), Marc Glisse, 01/29/2012
- Re: [cgal-discuss] Multithreading and do_intersect(..), Bernhard Kornberger, 01/29/2012
- Re: [cgal-discuss] Multithreading and do_intersect(..), Marc Glisse, 01/29/2012
Archive powered by MHonArc 2.6.16.