Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: Re: [cgal-discuss] CGAL+GMP and multithreading crash
  • Date: Fri, 16 Jul 2010 19:04:13 +0200 (CEST)

On Fri, 16 Jul 2010,

wrote:

Do you have any news on this ? I'm having the same issue with multithreading
and the Simple_cartesian<Gmpq> kernel. Do you plan to fix it someday ?

It is an old thread, you could give some context ;-)

It is not possible to make reference-counting thread-safe without slowing down single-threaded applications, so this hasn't been done yet. It is safe to use different Gmpq in different threads (as opposed to Gmpzf which may only be used in a single thread), but not to share one between threads.

I am assuming that you need an exact construction kernel, or you wouldn't be using this one.

You could try to use a type that does not use reference counting (mpq_class (from gmpxx.h) instead of Gmpq).

You could also make copies of all the objects that may be accessed (even read-only) by several threads, before starting the extra threads, and make sure each thread uses a different copy.

Or you could try making Gmpq thread-safer (there used to be a prototype there:
http://www.loria.fr/~glisse/tmp/atomic_counter/
but it probably doesn't even compile anymore)

Good luck,

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page