Re: [gdal-dev] GeoTIFF and concurrent block reads

2023-09-21 Thread Laurențiu Nicola via gdal-dev
On Thu, Sep 21, 2023, at 18:05, Even Rouault wrote: > >> Of course, but I'm asking if it's worth calling ReadBlock on multiple >> threads (if it always takes a lock, it's not, and I should use RasterIO >> instead). > Not on the same dataset object, otherwise you'll get crashes as no lock is >

Re: [gdal-dev] GeoTIFF and concurrent block reads

2023-09-21 Thread Even Rouault via gdal-dev
Of course, but I'm asking if it's worth calling ReadBlock on multiple threads (if it always takes a lock, it's not, and I should use RasterIO instead). Not on the same dataset object, otherwise you'll get crashes as no lock is taken (*) I think these can also be implemented at VSI level by w

Re: [gdal-dev] GeoTIFF and concurrent block reads

2023-09-21 Thread Laurențiu Nicola via gdal-dev
Hi, On Thu, Sep 21, 2023, at 17:02, Even Rouault wrote: > Laurentiu, > >> >> GDAL 3.6 added support for multi-threaded reading using PRead, but I >> couldn't spot ReadBlock using the same code path. > If you read one single block at a time, the multi-threaded optimization > cannot kick in, sin

Re: [gdal-dev] GeoTIFF and concurrent block reads

2023-09-21 Thread Even Rouault via gdal-dev
Laurentiu, GDAL 3.6 added support for multi-threaded reading using PRead, but I couldn't spot ReadBlock using the same code path. If you read one single block at a time, the multi-threaded optimization cannot kick in, since the elementary decoding unit is a block. You must call RasterIO()

[gdal-dev] GeoTIFF and concurrent block reads

2023-09-21 Thread Laurențiu Nicola via gdal-dev
Hello, GDAL 3.6 added support for multi-threaded reading using PRead, but I couldn't spot ReadBlock using the same code path. On the other hand, I didn't see it taking a lock either, so I'm a little confused :-). My question is whether ReadBlock supports concurrent reads or not (*). (*) I thin