title: How does this while loop exit?
body: <p>So, how does this code exit the while statement when the thread is started? (Please do not consider indentation)</p>
  
  <pre><code>class ThreadUrl(threading.Thread):
      """Threaded Url Grab"""
      def __init__(self, queue, out_queue):
          threading.Thread.__init__(self)
          self.queue = queue
          self.out_queue = out_queue
  
      def run(self):
          while True:
              #grabs host from queue
              host = self.queue.get()
  
              #grabs urls of hosts and then grabs chunk of webpage
              url = urllib2.urlopen(host)
              chunk = url.read()
  
              #place chunk into out queue
              self.out_queue.put(chunk)
  
              #signals to queue job is done
              self.queue.task_done()
  </code></pre>
  
  <p>** EDIT <em>*</em></p>
  
  <p>The code that starts the thread: </p>
  
  <pre><code>def main():
  
  #spawn a pool of threads, and pass them queue instance
      for i in range(5):
          t = ThreadUrl(queue)
          t.setDaemon(True)
          t.start()
  
      queue.join()
  </code></pre>