<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:3 0 5 9 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Chris, it really depends on how large your project is. Some of my projects cover 1000 sq miles.  Usually I don’t use QGIS directly for that, I break it down to smaller pieces. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Qgis-user <qgis-user-bounces@lists.osgeo.org> <b>
On Behalf Of </b>chris hermansen via Qgis-user<br>
<b>Sent:</b> Saturday, July 30, 2022 2:37 PM<br>
<b>To:</b> Greg Troxel <gdt@lexort.com><br>
<b>Cc:</b> qgis-user <qgis-user@lists.osgeo.org><br>
<b>Subject:</b> Re: [Qgis-user] excessive threads?<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Greg and list<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sat, Jul 30, 2022 at 10:38 AM Greg Troxel via Qgis-user <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><br>
(I realize excessive is relative.  Back when I was young, we didn't have<br>
any threads at all....)<br>
<br>
My desktop is NetBSD 9, I ran out of threads, and found that qgis 3.22.8<br>
was using 157 threads, much more than I expected.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[stuff deleted] <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
I really don't understand:<br>
<br>
  What is qgis using threads for?<br>
<br>
  Do others see large (100 or so, vs 10) thread counts?<br>
<br>
  Why are there 157 (really, why are there more than about 10-20)?<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal">Seems kind of surprising to me as well.  I get that some applications could benefit by parallel execution, and of course separating rendering from file or other I/O seems reasonable, but 157 is a lot of threads for just reading data and
 visualizing it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As far as I know, PostgreSQL doesn't even use threads.  See for example this discussion
<a href="https://dba.stackexchange.com/questions/251935/number-of-worker-threads-available-in-postgresql">
https://dba.stackexchange.com/questions/251935/number-of-worker-threads-available-in-postgresql</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">About SQLite I have no idea.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Does it seem like you have one thread per layer for reading plus one for rendering plus one for user  input?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Chris Hermansen · clhermansen "at" gmail "dot" com<br>
<br>
C'est ma façon de parler.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>