This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author merrellb
Recipients jnoller, merrellb
Date 2009-04-16.21:16:23
SpamBayes Score 1.2671162e-06
Marked as misclassified No
Message-id <1239916585.48.0.421219416102.issue4660@psf.upfronthosting.co.za>
In-reply-to
Content
Jesse,

I am afraid my last post may have confused the issue.  As I mentioned in
my first post, the problem arises when JoinableQueue.put is preempted
between its two lines.  Perhaps the easiest way to illustrate this is to
exacerbate it by modifying JoinableQueue.put to force a preemption at
this inopportune time.

import time
def put(self, item, block=True, timeout=None):
    Queue.put(self, item, block, timeout)
    time.sleep(1)
    self._unfinished_tasks.release()

Almost any example will now fail.

from multiprocessing import JoinableQueue, Process

def printer(in_queue):
    while True:
        print in_queue.get()
        in_queue.task_done()

if __name__ == '__main__':
    jqueue = JoinableQueue()
    a = Process(target = printer, args=(jqueue,)).start()
    jqueue.put("blah")
History
Date User Action Args
2009-04-16 21:16:25merrellbsetrecipients: + merrellb, jnoller
2009-04-16 21:16:25merrellbsetmessageid: <1239916585.48.0.421219416102.issue4660@psf.upfronthosting.co.za>
2009-04-16 21:16:24merrellblinkissue4660 messages
2009-04-16 21:16:23merrellbcreate