[Shapelib] is the shaplib library thread safe???

C S usmsci at yahoo.com
Fri Nov 30 15:53:07 EST 2007


here i what concerns me. i am writing my own shapefile
reader in C++ and i am at the point now to where i can
use my .shp file and my .dbf file to take an area of
interest(AOI) and get a "value" for like population or
something for that AOI. 

we arent going to use ESRI for this but the client is
going to have multiple AOI's that make up a bounding
box. each 'cell' will have its own bounding area and
thus will naturally get back different results. you
can have 15 cells for instance with each its own AOI.

the idea is that every cell can fire off at once,
probing the shapefile reader class i have created that
will go out to the dbf file and return results. 

so what i am getting from you is that this is really
not possible currently? 

thanks! 


--- Frank Warmerdam <warmerdam at pobox.com> wrote:

> Bram de Greve wrote:
> > C S wrote:
> >> i am going to be using the library for multi
> >> processing and was wondering or just making sure
> if it
> >> was thread safe...thanks!
> >>   
> > AFAIK, the library itself is thread safe, but the
> different objects are
> > not.  So, it should be safe to open two different
> DBF files in two
> > different threads, but opening one DBF file and
> accessing it from
> > different threads is not.
> > 
> > Frank, am I right on this? =)
> 
> Bram,
> 
> I think that is correct.   I did an analysis of the
> core shapelib code
> a few months ago and fixed two things:
> 
>   * Revision 1.73  2007/09/03 19:48:11  fwarmerdam
>   * move DBFReadAttribute() static dDoubleField into
> dbfinfo
>   *
>   * Revision 1.72  2007/09/03 19:34:06  fwarmerdam
>   * Avoid use of static tuple buffer in
> DBFReadTuple()
> 
> With those changes I believe it is thread safe.  So
> C S should likely
> grab shapelib from CVS for safest operation.
> 
> Best regards,
> -- 
>
---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank
> Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows |
> http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President
> OSGeo, http://osgeo.org
> 
> _______________________________________________
> Shapelib mailing list
> Shapelib at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/shapelib
> 



      ____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 


More information about the Shapelib mailing list