[Gdal-dev] Is OGR reentrant?

Marek Brudka mbrudka at aster.pl
Sat Sep 23 05:19:42 EDT 2006


Hi
ugeni79 at gmail.com wrote:
> Given that OGR is not reentrant and is not thread safe, is there any 
> way I can get OgrDatasources to work for concurrent reading from 
> different threads? or is ot my only choice to spin off a separate 
> process for each of the data sources?
Just because of thread safety problems I my company we sticked to GDAL 
1.26 and made it thread safe for bothWindows and Linux.  Unfortunatelly, 
patches did not enter the main GDAL repository, thought we tried.. But, 
when mutually accessing two different datasources you should not care 
about thread safety at all, if of course a datasource and all its 
products like layers, features, definitions and spatial references are 
really employed in the same thread. For example you may get into 
troubles when a spatial reference from a layer produced by datasource A 
in thread 1 is accessed in thread 2.

HTH
Marek



More information about the Gdal-dev mailing list