[gdal-dev] Block caching in gdal.Dataset()s opened by different threads/processes
Javier Jimenez Shaw
j1 at jimenezshaw.com
Mon Feb 17 08:43:31 PST 2025
GDAL raster cache works in one process for any thread in that process. It
is not shared among different processes.
See that reading simultaneously from the same dataset object in different
threads many corrupt your cache. Do not do that!
On Mon, 17 Feb 2025 at 17:38, Rami DV via gdal-dev <gdal-dev at lists.osgeo.org>
wrote:
> Hello gdal-dev!
>
> Please forgive me for the newbie question, I am just now starting to
> develop more deeply with GDAL rather than just using the command line
> programs.
>
> I'm writing a program which opens a GDAL Tile Index from various different
> threads & processes, and I would like to keep an LRU cache of the blocks
> which are accessed, to speed up performance.
>
> From what I understand reading the GDALRasterBlock docs, GDAL keeps a
> global raster cache of the latest blocks accessed. But what I'm not sure,
> is if that cache is global within a particular thread/process, or if it's
> global across all threads/processes.
>
> So, these are the questions: does GDAL cache work across
> threads/processes? Any tips on doing global caching other than rolling my
> own outside of GDAL?
>
> Thanks in advance for the help & for the great software!
> Rami
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250217/907dbf91/attachment.htm>
More information about the gdal-dev
mailing list