<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>On 10/14/2022 3:00 AM, Even Rouault wrote:<br>
    </p>
    <blockquote type="cite" cite="mid:9f24c89e-ccfc-9b57-51a3-de0c9b034c9d@spatialys.com">
      
      <p>Hi,</p>
      <p>just wanted to point that if you are interested in a
        "framework" for submit jobs to a thread pool, I can point to<br>
      </p>
      <p><a class="moz-txt-link-freetext" href="https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.h" moz-do-not-send="true">https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.h</a></p>
      <p><a class="moz-txt-link-freetext" href="https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.c" moz-do-not-send="true">https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/thread.c</a></p>
      <p>which is a port in C I've done from the equivalent C++ code of
        GDAL
        (<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/master/port/cpl_worker_thread_pool.h" moz-do-not-send="true">https://github.com/OSGeo/gdal/blob/master/port/cpl_worker_thread_pool.h</a>).</p>
      <p>It has a pthread and Win32 implementation. It could be easily
        extracted from libopenjp2 (pending a opj_ -> grass_ renaming
        to avoid conflicts if both are combined)</p>
      <p>The high level API is the <span class="pl-c1">opj_thread_pool_*
          one.<br>
        </span></p>
      <p>Probably not super fancy, but serves my need well. The user is
        responsible for selecting the number of threads and splitting
        the work load in jobs that are queued to the thread pool and
        consumed by the threads as soon as they are no longer busy.</p>
    </blockquote>
    <p>Thank you for the pointers and links. I will definitely take a
      look at it and see what I can incorporate. Between this and the
      various drivers, I think I have more than enough to work on for
      awhile.</p>
    <p>Thank you all for indulging and tolerating my questions.<br>
    </p>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Best Regards,
-Brad</pre>
  </body>
</html>