title: parallel threading without waiting for other thread in python
body: <p>Hi I am trying to run two threads here <code>function1</code> and <code>function2</code>. I what <code>function1</code> to run first and while <code>function1</code> is paused at <code>time.sleep(1000)</code>.I expert <code>function2</code> to start immediately along with <code>function1</code> and continue it function.</p>
  
  <pre><code>import thread
  import time
  
  
  # Define a function for the thread
  def function1( threadName, delay):
      print "%s: %s" % ( threadName, time.ctime(time.time()) )
      time.sleep(1000)
  
  def function2( threadName, delay):
     count = 0
     while count &lt; 5:
        time.sleep(delay)
        count += 1
        print "%s: %s" % ( threadName, time.ctime(time.time()) )
  
  
  # Create two threads as follows
  try:
     thread.start_new_thread( function1, ("Thread-1", 2, ) )
     thread.start_new_thread( function2, ("Thread-2", 4, ) )
  except:
     print "Error: unable to start thread"
  
  while True:
      pass
  </code></pre>
  
  <p><strong>Return</strong></p>
  
  <pre><code> Thread-1: Tue Sep 22 19:10:03 2015
  </code></pre>