[gdal-dev] Reason not to enable gdal --with-threads by default?

Frank Warmerdam warmerdam at pobox.com
Mon Aug 30 15:29:39 EDT 2010


Dane Springmeyer wrote:
> In the Mapnik library we open a GDALDataset per thread, for each feature
> query, but have been seeing crashes when rendering large geotiffs.
> 
> I've assumed that GDALDataset was fairly threadsafe in recent revisions as
> per
> (http://trac.osgeo.org/gdal/wiki/FAQMiscellaneous#IstheGDALlibrarythread-safe),
> but recently learned that you must force --with-threads during configure to
> get this working.
> 
> Once I rebuilt gdal --with-threads all my troubles went away.
> 
> Are there caveats or other reasons not to pass --with-threads during the
> configure stage. E.g. should is not be made default some time in the future?

Dane,

There will inevitably be some performance cost to turning on the locking.
I don't know how much that would be.  Also, some platforms (in the past)
did not have good pthread implementations easily available though that is
likely not so true now.

Likely threads ought to be enabled by default in GDAL unix/linux builds.

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