multiprocessing Pool.imap broken?

Discussion in 'Python' started by Yang Zhang, Mar 30, 2011.

  1. Yang Zhang

    Yang Zhang Guest

    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
     
    Yang Zhang, Mar 30, 2011
    #1
    1. Advertising

  2. Yang Zhang

    Yang Zhang Guest

    The problem was that Pool shuts down from its finalizer:

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

    On Wed, Mar 30, 2011 at 5:59 AM, eryksun () <> wrote:
    > On Tuesday, March 29, 2011 9:44:21 PM UTC-4, Yang Zhang 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

    >
    > 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'
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >




    --
    Yang Zhang
    http://yz.mit.edu/
     
    Yang Zhang, Mar 31, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik Ormåsen

    Curier-IMAP and imap.create()

    Henrik Ormåsen, Aug 19, 2006, in forum: Ruby
    Replies:
    0
    Views:
    178
    Henrik Ormåsen
    Aug 19, 2006
  2. Jon Fi
    Replies:
    4
    Views:
    542
    Kashia Buch
    Oct 21, 2006
  3. jasonnaylor
    Replies:
    1
    Views:
    256
    jasonnaylor
    Apr 16, 2008
  4. Adam Akhtar
    Replies:
    1
    Views:
    179
    Eric Hodel
    Dec 15, 2008
  5. Abhishiv Saxena

    Support for IMAP IDLE in net/imap

    Abhishiv Saxena, Jul 3, 2009, in forum: Ruby
    Replies:
    4
    Views:
    197
    Eric Hodel
    Jul 4, 2009
Loading...

Share This Page