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

Frank Warmerdam warmerdam at pobox.com
Fri Nov 30 08:43:04 PST 2007

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? =)


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

More information about the Shapelib mailing list