title: Python 2.6 multiprocessing.Queue compatible with threads?
body: <p>I am experimenting with the new multiprocessing module in Python 2.6.  I am creating several processes each with its own multiprocessor.JoinableQueue instance.  Each process spawns one or more worker threads (subclasses of threading.Thread) which share the JoinableQueue instance (passed in through each Thread's <code>__init__</code> method).  It seems to generally work but occasionally and unpredictably fails with the following error:</p>
  
  <pre><code>  File "C:\Documents and Settings\Brian\Desktop\testscript.py", line 49, in run
      self.queue.task_done()
    File "C:\Python26\lib\multiprocessing\queues.py", line 293, in task_done
      raise ValueError('task_done() called too many times')
  ValueError: task_done() called too many times
  </code></pre>
  
  <p>My Queue get() and task_done() calls are right after each other so they should be equal.  Anecdotally this seems to occur only when the work done between the get() and the task_done() is VERY quick.  Inserting a small <code>time.sleep(0.01)</code> seems to alleviate the problem.</p>
  
  <p>Any ideas what is going on?  Can I use a multiprocessor Queue with threads instead of the more traditional (Queue.Queue)?</p>
  
  <p>Thanks!</p>
  
  <p>-brian</p>