title: Threading in Python - Threads or processes?
body: <p>How are threads implemented in python? Does python create a separate process for each thread?</p>
  
  <p>Consider this code.</p>
  
  <pre><code>from threading import Thread
  from time import sleep
  
  
  class testThread(Thread):
      def __init__(self):
          Thread.__init__(self)
      def run(self):
          while True:
              print "Thread inner!"
              sleep(5)
  threadTest = testThread()
  threadTest.start()       
  while True:
      print "Thread outer!"
      sleep(10)
  </code></pre>
  
  <p>On running this code on the shell and then doing a Ctrl+C the "Thread outer" print stops coming, however the "Thread inner" continues to  get printed until i manually kill it using 'kill -9 pid' command.</p>