Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2207 > unrolled thread

Re: multiprocessing Pool.imap broken?

Started byYang Zhang <yanghatespam@gmail.com>
First post2011-03-29 18:51 -0700
Last post2011-03-29 18:51 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: multiprocessing Pool.imap broken? Yang Zhang <yanghatespam@gmail.com> - 2011-03-29 18:51 -0700

#2207 — Re: multiprocessing Pool.imap broken?

FromYang Zhang <yanghatespam@gmail.com>
Date2011-03-29 18:51 -0700
SubjectRe: multiprocessing Pool.imap broken?
Message-ID<mailman.6.1301449911.2990.python-list@python.org>
On Tue, Mar 29, 2011 at 6:44 PM, Yang Zhang <yanghatespam@gmail.com> wrote:
> 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
>

In case anyone jumps on this, this isn't an issue with running from the console:

$ cat /tmp/go3.py
import multiprocessing as mp
print mp.Pool(1).map(abs, range(3))
print list(mp.Pool(1).imap(abs, range(3)))

$ python /tmp/go3.py
[0, 1, 2]
^C^C^C^C^C^\Quit

(I've actually never seen the behavior described in the corresponding
Note at the top of the multiprocessing documentation.)

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web