[gdal-dev] Multithreading issue on pixel-based intensive access (GDAL 2.1.0)

Even Rouault even.rouault at spatialys.com
Sat Jul 30 08:09:33 PDT 2016


> I have attached a simple code to reproduce it (Test.cpp). If you need the
> whole solution just ask me, although it is a very simple console test. I
> have also shared with you the zipped datasets through this link:
> https://drive.google.com/file/d/0B-OCl1FjBi0YblRPRGZlQWx4eEE/view?usp=shari
> ng Just place them along with Test.exe file.

I managed to reproduce on Linux after some compilation fixes in your driver 
(constants _UI8_MAX and similar ones aren't recognized. I just commented out 
that code), and changing your Test.cpp to use GDAL thread machinery, since 
std::future/std::async doesn't create threads with gcc (4.8.4) for some reason 
but runs everything sequentially in the main thread.
The issue was that the call to GDALSetCacheMax() prevented the raster block 
mutex from being created. Fixed per https://trac.osgeo.org/gdal/ticket/6611. 
As a workaround you can call GDALGetCacheMax() just before.

> IMPORTANT: Bear in mind that these datasets come in a format still not
> supported officially by GDAL, as I am developing the driver. It is almost
> finished (just a few details pending) and fully working. Find the driver
> attached (Wizard_Driver.7z). By the way, what do we have to do to
> contribute with this new driver for GDAL?

See https://trac.osgeo.org/gdal/wiki/HowToContribute


Spatialys - Geospatial professional services

More information about the gdal-dev mailing list