title: Multithreading with two infinite while functions
body: <p>I am working on a code which contains a while loop which always has the condition as True.
  Is there some method by which i can initiate two threads and run them despite of the infinite loop present.?</p>
  
  <pre><code>##code
  from threading import Thread
  class myClass():
     def __init__():
        ##code here..
     def run(self):
        print 'Starting '
        while(True):
           print '1'
  class myClassSecond():
     def __init_():
         ##code here
     def run(self):
         print 'starting second'
         while(True):
             print '2'
  
  
  if __name__=='__main__':
     a=myClass()
     b=myClassSecond()
     aa=Thread(a.run())
     bb=Thread(b.run())
     aa.start()
     bb.start()
     aa.join()
  </code></pre>
  
  <p>On execution the Thread aa gets started but because of the while loop , aa won't exit from itself.and due to this Thread bb will not start.Is there any other approach with which i  can start these two thread.(P.S. while loop cannot be removed from code.)</p>
  
  <p>OUTPUT:</p>
  
  <pre><code>1
  1
  1
  1
  1
   and so on.
  </code></pre>
  
  <p>Required output:
  It should atleast give me somethin like :</p>
  
  <p>1</p>
  
  <p>2</p>
  
  <p>kindof thing</p>