title: Threading / Queue in Python
body: <p>I intend using threads/queues with python 2.5.2
  But it seems that python becomes freezed at the queue.join()-command.
  The output of the followong code is only: BEFORE</p>
  
  <pre><code>import Queue
  import threading
  
  queue = Queue.Queue()
  
  class ThreadUrl(threading.Thread):
  
      def __init__(self, queue):
          threading.Thread.__init__(self)
          self.queue = queue
  
      def run(self):
          while True:
  
              i = self.queue.get()
              print i
              self.queue.task_done()
  
  
  def main():
  
      for i in range(5):
          t = ThreadUrl(queue)
          t.setDaemon(True)
          t.start()
  
      for i in range(5):
          queue.put(i)
  
      print "BEFORE"
      queue.join()
      print "AFTER"
  
  
  main()
  </code></pre>
  
  <p>Has someone an idea about what is going wrong?</p>