Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: CGAL+GMP and multithreading crash

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: CGAL+GMP and multithreading crash


Chronological Thread 
  • From: giannis assiouras <>
  • To:
  • Subject: Re: [cgal-discuss] Re: CGAL+GMP and multithreading crash
  • Date: Mon, 16 Jul 2012 19:18:25 +0200

Dear Marc,

I am trying to fix the reference counting mechanism for CGAL in order to use the library for multi-threaded applications. What I have done so far is to use gcc atomics for the manipulation of the counter inside Handle.h and Handle_for.h.  With this solution I can get quite a good performance for my multi-threaded application without any errors.
 
However, I am quite sure that there are some other parts of the code that need to be secured like the update_exact method Lazy constructed objects. Could you please highlight to me any other code that I need to secure in order to make the library thread safe?

Best Regards,
Ioannis

2012/5/2 Marc Glisse <>
On Wed, 2 May 2012, giannis assiouras wrote:

Thanks for your answer. I am also considering the alternative of making
copies of all the objects that may be accessed by several threads.. However,
since all copies of an object share a common representation object storing
the data associated with a kernel object how this solution could be thread
safe with the current implementation?

You need to construct new objects instead of copying.
For Gmpq:
Gmpq b=a.mpq();

For a point, take its x, y and z coordinates, "copy" them by the method above, and construct a new point from the 3 coordinates. With Lazy_*, which you get with Epeck, you may need to use .exact() to get the real representation.

Are you sure the filtered version of Simple_cartesian<mpq_class> is not good enough for you?

--
Marc Glisse




Archive powered by MHonArc 2.6.18.

Top of Page