title: how can I apply loop to multithreading in python
body: <p>I just started learning about multithreading, and I have a question about applying loop.</p>
  
  <p>As shown in code below I am trying to run multithreading until length of self.llist is longer than 10.</p>
  
  <p>Code below works fine, but I'm not sure if that's efficient way to run in loop.</p>
  
  <pre><code>import threading
  
  class aa:
      def __init__(self):
          self.llist = []
  
      def task1(self):
          self.llist.append('task1')
  
      def task2(self):
          self.llist.append('task2')
  
      def main(self):
          while len(self.llist) &lt; 10:
              t1 = threading.Thread(target=self.task1, name='t1')
              t2 = threading.Thread(target=self.task2, name='t2')
  
              t1.start()
              t2.start()
  
              t1.join()
              t2.join()
  
  aa().main()
  </code></pre>