multiprocessing Pool.imap broken?

Y

Yang Zhang

I've tried both the multiprocessing included in the python2.6 Ubuntu
package (__version__ says 0.70a1) and the latest from PyPI (2.6.2.1).
In both cases I don't know how to use imap correctly - it causes the
entire interpreter to stop responding to ctrl-C's. Any hints? Thanks
in advance.

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import multiprocessing as mp
mp.Pool(1).map(abs, range(3)) [0, 1, 2]
list(mp.Pool(1).imap(abs, range(3)))
^C^C^C^C^\Quit
 
Y

Yang Zhang

The problem was that Pool shuts down from its finalizer:

http://stackoverflow.com/questions/5481104/multiprocessing-pool-imap-broken/5481610#5481610

I've tried both the multiprocessing included in the python2.6 Ubuntu
package (__version__ says 0.70a1) and the latest from PyPI (2.6.2.1).
In both cases I don't know how to use imap correctly - it causes the
entire interpreter to stop responding to ctrl-C's.  Any hints?  Thanks
in advance.

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import multiprocessing as mp
mp.Pool(1).map(abs, range(3)) [0, 1, 2]
list(mp.Pool(1).imap(abs, range(3)))
^C^C^C^C^\Quit

It works fine for me on Win32 Python 2.7.1 with multiprocessing 0.70a1. So it's probably an issue with the implementation on Linux.

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46)
[MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import multiprocessing as mp
list(mp.Pool(1).imap(abs, range(3))) [0, 1, 2]
mp.__version__
'0.70a1'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top