[gdal-dev] Is GDAL reentrant

Frank Warmerdam warmerdam at pobox.com
Mon Nov 10 08:53:52 EST 2008


Clay, Bruce wrote:
> I have a Microsoft application with multiple tabs / property pages. 
>  Each tab is controlled by a separate class.  I have a separate instance 
> of GDAL in each class.  I also had an instance in a popup that I used to 
> connect to the database.  After the user logins and the popup window 
> goes away it seems that I have to reregister the OGR drivers in the tabs 
> as if the OGRCleanupAll in the destructor of the popup was being applied 
> to the instances in the tabs as well.
> 
>  
> 
> Is GDAL / OGR reentrant?  Can we have multiple instances that act 
> independently?

Bruce,

GDAL/OGR is endeavors to achieve some forms of re-entrancy.  In particular
it should be possible to have distinct threads accessing distinct
GDALDataset objects in read-only mode for "well behaved" drivers.  This
is also generally true of OGRDataSource objects.

However, a call to OGRCleanupAll() or other similar funcitions that
tear down the environment should only generally be done on application
exit, not cleanup of a single thread.

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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list