title: How to implement a dynamic amount of concurrent threads?
body: <p>I am launching concurrent threads doing some stuff:</p>
  
  <pre><code>concurrent = 10
  q = Queue(concurrent * 2)
  for j in range(concurrent):
      t = threading.Thread(target=doWork)
      t.daemon = True
      t.start()
  try:
      # process each line and assign it to an available thread
      for line in call_file:
          q.put(line)
      q.join()
  except KeyboardInterrupt:
      sys.exit(1)
  </code></pre>
  
  <p>At the same time I have a distinct thread counting time:</p>
  
  <pre><code>def printit():
      threading.Timer(1.0, printit).start()
      print current_status
  
  printit()
  </code></pre>
  
  <p>I would like to increase (or decrease) the amount of concurrent threads for the main process let's say every minute. I can make a time counter in the time thread and make it do things every minute but how to change the amount of concurrent threads in the main process ?</p>
  
  <p>Is it possible (and if yes how) to do that ?</p>