<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>We could have a OSRSetAutoclosePROJDatabase() global function
      that would call proj_context_set_autoclose_database() when it
      creates the per-thread PROJ context<br>
    </p>
    <p>==> ogr/ogr_proj_p.cpp</p>
    <p>An alternative would be to enhance PROJ to have a mode where the
      SQLite3 db handle would be shared amongst several contexts. In
      theory that could be possible as you can invoke sqlite3_open_v2()
      with SQLITE_OPEN_FULLMUTEX. But would require non completely
      trivial changes<br>
    </p>
    <div class="moz-cite-prefix">Le 28/04/2021 à 15:30, Andrew Bell a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CACJ51z3eybKc8SPoSOH9+zymRMBLt57d6F8dAGgPPiLk_8=sFA@mail.gmail.com">
      <div dir="ltr">
        <div dir="ltr">On Tue, Apr 27, 2021 at 11:44 PM Alan Snow <<a
            href="mailto:alansnow21@gmail.com" moz-do-not-send="true">alansnow21@gmail.com</a>>
          wrote:<br>
        </div>
        <div class="gmail_quote">
          <blockquote class="gmail_quote">
            <div dir="auto">By default pyproj uses the autoclose option
              and provides this option for users who want better
              performance and know they have a single threaded
              application: <a
                href="https://pyproj4.github.io/pyproj/stable/api/global_context.html"
                target="_blank" moz-do-not-send="true">https://pyproj4.github.io/pyproj/stable/api/global_context.html</a></div>
          </blockquote>
          <div><br>
          </div>
          <div>Thanks for this!  But it appears that the PROJ context
            held by a thread using GDAL is private, so I don't think I
            can call proj_context_set_autoclose_database(). I think I'm
            going to have to make sure that the thread actually
            terminates in order to release the context.</div>
          <div><br>
          </div>
          <div>If someone has other suggestions, I'd be happy to hear
            them.</div>
          <div><br>
          </div>
        </div>
        -- <br>
        <div dir="ltr" class="gmail_signature">Andrew Bell<br>
          <a href="mailto:andrew.bell.ia@gmail.com" target="_blank"
            moz-do-not-send="true">andrew.bell.ia@gmail.com</a></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <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>