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


Groups > comp.lang.python > #2295

Re: multiprocessing Pool.imap broken?

References <mailman.5.1301449484.2990.python-list@python.org> <17e12347-5f4f-4340-9436-a94cef63059e@glegroupsg2000goo.googlegroups.com>
From Yang Zhang <yanghatespam@gmail.com>
Date 2011-03-31 11:46 -0700
Subject Re: multiprocessing Pool.imap broken?
Newsgroups comp.lang.python
Message-ID <mailman.40.1301597213.2990.python-list@python.org> (permalink)

Show all headers | View raw


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 () <eryksun@gmail.com> 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/

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: multiprocessing Pool.imap broken? "eryksun ()" <eryksun@gmail.com> - 2011-03-30 05:59 -0700
  Re: multiprocessing Pool.imap broken? Yang Zhang <yanghatespam@gmail.com> - 2011-03-31 11:46 -0700

csiph-web