[geos-devel] Issues with smart pointers and threads?

Martin Davis mbdavis at VividSolutions.com
Tue May 27 20:28:27 EDT 2003


I agree, Dave - I think that reference counting is going to be a lot harder to implement, debug, and verify than simply using value objects.  I'd prefer to avoid as much complexity as possible in GEOS - dealing with the algorithm side of things is complex enough.  

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040    Fax: (250) 385 6046
EMail: mbdavis at vividsolutions.com  Web: www.vividsolutions.com


> -----Original Message-----
> From: David Blasby [mailto:dblasby at refractions.net]
> Sent: Tuesday, May 27, 2003 5:12 PM
> To: GEOS Development List
> Subject: Re: [geos-devel] Issues with smart pointers and threads?
> 
> 
> I'm a bit concerned with using the reference counting since it could 
> cause us some grief.  However, if this open source reference 
> counter is 
> good this might be easy.
> 
> Personally, I think wasting a wee bit of space for the 
> precision model 
> in a geometry isnt going to be that big a deal.
> 
> As for thread-safety, consider this:
> 
> Single threaded application makes a PrecisionModel.
> This application forks 2 threads that both have access to this 
> PrecisionModel.
> Both threads create a bunch of geometries using the PrecisionModel.
> 
> If your reference counting is *not* thread-safe (ie. protected by a 
> semephore), then there is a race condition if both threads try to 
> increment the reference count at the same time.
> 
> dave
> 
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 



More information about the geos-devel mailing list