code: def _start(self, worker=None):
          
          if worker:
              self._queue_workers.append(worker)
  
          if self._queue_workers and self._running_threads < self._max_threads:
              #print('Queue: {0} Running: {1} Workers: {2} '
              #       'Threads: {3}'.format(len(self._queue_workers),
              #                                 self._running_threads,
              #                                 len(self._workers),
              #                                 len(self._threads)))
              self._running_threads += 1
              worker = self._queue_workers.popleft()
              thread = QThread()
              if isinstance(worker, PythonWorker):
                  worker.moveToThread(thread)
                  worker.sig_finished.connect(thread.quit)
                  thread.started.connect(worker._start)
                  thread.start()
              elif isinstance(worker, ProcessWorker):
                  thread.quit()
                  worker._start()
              self._threads.append(thread)
          else:
              self._timer.start()
  
          if self._workers:
              for w in self._workers:
                  if w.is_finished():
                      self._bag_collector.append(w)
                      self._workers.remove(w)
  
          if self._threads:
              for t in self._threads:
                  if t.isFinished():
                      self._threads.remove(t)
                      self._running_threads -= 1
  
          if len(self._threads) == 0 and len(self._workers) == 0:
              self._timer.stop()
              self._timer_worker_delete.start()
docs: Start threads and check for inactive workers.