OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.84k stars 2.53k forks source link

FR: GTiff: Allow concurrent reading of single blocks #8448

Open lnicola opened 1 year ago

lnicola commented 1 year ago

GTiff supports multi-threaded reads by using PRead (and, I suspect, by doing the I/O outside of libtiff/libgeotiff). It would be useful if this could be extended to reading single blocks. Currently, the alternatives are:

rouault commented 1 year ago

if this could be extended to reading single blocks

I don't see any easy resolution for that. This goes against a lot of assumptions in the design of GDAL. If that was going to be implemented, it would have implications probably on core and should be done driver by driver, with a lot of caution to lock the appropriate data structures, and probably a driver capability advertising that sch multi-threaded reads can be safely done. For GTiff, not only the file access should be done in a per-thread way, but a TIFF* handle also hides a lot of state and shouldn't be used from several threads.

latot commented 1 year ago

This seems great!