Matthew Leon Grinshpun <vertesp...@gmail.com> added the comment:

I have attached a patch. All I did was shift the one line from __init__
to _setup_queues.

That's it.

You could take advantage of the change in the following way:

class BlockingPool(pool.Pool):
    def _setup_queues(self):
        pool.Pool._setup_queues(self)
        self._taskqueue = Queue(3)
        self._inqueue = Queue(3)
        self._quick_put = self._inqueue.put

Because of the design of _handle_tasks thread, you need to cap both
_taskqueue and _inqueue for blocking to work out.

I can't see any potential problems caused by this change, but I have
little experience working with this module so far.

----------
keywords: +patch
Added file: http://bugs.python.org/file14442/multiproc.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6407>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to