<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Laurentiu,<br>
    </p>
    <blockquote type="cite"
      cite="mid:87756158-76a1-4ab5-aa08-95e231973fd7@betaapp.fastmail.com">
      <div style="font-family:Arial;"><br>
      </div>
      <div style="font-family:Arial;">GDAL 3.6 added support for
        multi-threaded reading using PRead, but I couldn't spot
        ReadBlock using the same code path. </div>
    </blockquote>
    <p>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() with a window intersecting
      several block.<br>
    </p>
    <blockquote type="cite"
      cite="mid:87756158-76a1-4ab5-aa08-95e231973fd7@betaapp.fastmail.com">
      <div style="font-family:Arial;"><br>
      </div>
      <div style="font-family:Arial;">(*) I think these can also be
        implemented at VSI level by wrapping a file handle and turning
        Seek + Read into a PRead (when supported), even for drivers that
        don't explicitly support PRead.<br>
      </div>
    </blockquote>
    <p>The multi-threaded optimization also works for VSI file systems
      not supported PRead(), but doing what you mention above: doing
      Seek+Read under a lock. This is of course less efficient.</p>
    <p>Even</p>
    <br>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>