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: Philipp Moeller <>
  • To:
  • Cc:
  • Subject: Re: [cgal-discuss] Re: CGAL+GMP and multithreading crash
  • Date: Tue, 01 May 2012 21:09:35 +0200
  • Organization: GeometryFactory

Marc Glisse
<>
writes:

> On Tue, 1 May 2012,
>
> wrote:
>
>> Many thanks for your response. Could you give me some quick
>> instructions if I go and fix the reference counting mechanism
>> e.g. pointer to some existing prototype, what support is already
>> there and what needs to be done.
>
> Replacing unsigned int with std::atomic_uint for the member "count" in
> CGAL/Handle_for.h would go a long way for Gmpq. You can try similar
> things in other Handle* files, Handle.h looks like it might be ok with
> a simple int -> std::atomic_int, Handle_with_policy would be
> hard. Sorry, if it was trivial it probably would have been done
> already.

Another approach I have been pondering is to simply throw all our ref
counted objects into shared_ptr. At least the boost version uses atomic
counters on most platforms and it would relieve us from the burden of
having our own reference counting mechanism.

This might have some drawbacks I don't see yet. At least
boost::shared_ptr is known to have some performance deficiencies
compared to vendor implementations.

It would be an interesting experiment at least.

--
Philipp Moeller
GeometryFactory



Archive powered by MHonArc 2.6.16.

Top of Page