title: linux python threading limit
body: <p>I'm having a problem starting more than 8 threads using <code>threading</code> in Python 2.7 (running on Raspbian Jessie).</p>
  
  <p>If I run</p>
  
  <pre><code>import threading
  
  my_func_1()
  my_func_2()
  my_func_3()
  my_func_4()
  my_func_5()
  threading.Thread(target=my_func_6).start()
  my_func_7()
  my_func_8()
  my_func_9()#this is never reached
  my_func_10()#nor this
  </code></pre>
  
  <p>where functions 1-5,7-10 have the form:</p>
  
  <pre><code>def my_func_1():
      global some_global_vars
      #do stuff here, involving global and local variables...
  
      threading.Timer(0.02,my_func_1).start()
  </code></pre>
  
  <p>and function 6 has the form</p>
  
  <pre><code>def my_func_6():
      while 1:
          #do stuff
  </code></pre>
  
  <p>then only the first 8 functions get executed. I feel this might be related to <a href="https://stackoverflow.com/questions/344203/maximum-number-of-threads-per-process-in-linux">thread-per-process limits in linux</a> but I couldn't quite get my head around it. Individually the functions run fine, and it's always the first 8 that execute (regardless of the order they're launched in).</p>
  
  <p>How would I check if it's a thread-per-process issue? Or is it something else altogether?</p>