title: Thread, QThread, how many per process is "reasonable"?
body: <p><strong>QUESTION:  How many "QThread" instances per process is "reasonable"?</strong></p>
  
  <p><em>(This specifically references Qt's <code>QThread</code> instance, but logically the question should relate to any thread-based design using any library.)</em></p>
  
  <p>For example, I understand that platform-specific resource limits may default to supporting up to thirty (30) "<code>QTcpSocket</code>" instances, so in theory, if you have thirty active-sockets, that would be thirty <code>QThread</code> instances when the system is under max-load.  However, that may not be a big deal, as most of those threads should be "sleeping/waiting" for network traffic.</p>
  
  <p>Similarly, I would assume that one would instantiate UP TO the number of "cores" or "native-threads-can-execute" for <code>QThread</code> instances charged with "heavy-continuous-work".  So, if you had eight (8) cores, that might be another eight <code>QThread</code> instances (and these may be working all-the-time when the system is under max-load).</p>
  
  <p>Then, of course, we have the "main-thread".</p>
  
  <p>Does this then imply one would instantiate:</p>
  
  <p>(30 socket-threads) + (8 worker-for-each-core) + (1 main thread)</p>
  
  <p>...for 39 threads (on an 8-core system)?</p>
  
  <p>Specifically, if application-specific needs had other thread-pool-needs, and you add a dozen-<code>QThread</code>-here and a dozen-<code>QThread</code>-instances-there, it seems like 100 <code>QThread</code> instances is kinda stupid, even if most of them are "idle/sleeping/waiting", right?</p>
  
  <p>So, is there a cut-off?  "39-threads" is "reasonable", but "300-threads" is "unreasonable"?</p>
  
  <p>(Yes, I understand there is a "default-stack-size-per-thread", such as "10MB-per-thread", so I am limited by virtual memory.  But, really, is it stupid to instantiate 30K threads -- it's a bad design that would ever want such a thing?)</p>