[Gdal-dev] Is OGR reentrant?

Marek Brudka mbrudka at aster.pl
Fri Sep 22 13:31:02 EDT 2006


ugeni79 at gmail.com napisał(a):
> Hi,
> I am using gdal 1.3.1 on windows and when I try to read from two 
> different shapefiles at the same time from two different threads my 
> application crashes. Is OGR (or maybe in this case shapelib) supposed 
> to be reentrant? If not, has anyone looked at what it would take to 
> make it reentrant?
> Any help would be greatly appreciated!
Hi,

OGR is neither reentrant nor thread-safe. There were some efforts in 
GDAL 1.3.x to make it thread safe, but the work does not seem to be 
finished. There some fundamental architectural misconceptions in OGR 
which prevents GDAL to be thread safe.
However you should not care about all of that that during mutual access 
to two different shapes from two different threads. AFAIK the code in 
OGR related with PROJ.4's thread unsafety is guarded quite well.

Regards
Marek




More information about the Gdal-dev mailing list