Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.212.46': 0.03; 'received:mail-vw0-f46.google.com': 0.03; 'pypi': 0.04; 'responding': 0.04; 'ubuntu': 0.04; 'wed,': 0.04; 'interpreter': 0.07; 'url:mit': 0.07; 'python': 0.07; 'advance.': 0.09; '>>>>': 0.09; '[0,': 0.09; 'linux.': 0.09; 'subject:broken': 0.09; '>>>': 0.12; 'win32': 0.12; 'am,': 0.14; 'wrote:': 0.14; '"copyright",': 0.16; '"credits"': 0.16; '"license"': 0.16; '[gcc': 0.16; 'linux2': 0.16; 'python2.6': 0.16; 'fine': 0.18; 'cc:no real name:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:addr:python- list': 0.22; 'nov': 0.24; 'received:209.85.212': 0.25; 'cases': 0.25; 'says': 0.25; 'url:mailman': 0.27; 'tried': 0.27; 'message- id:@mail.gmail.com': 0.28; 'url:edu': 0.28; 'problem': 0.29; 'subject:?': 0.29; 'probably': 0.30; 'cc:addr:python.org': 0.31; 'cc:addr:gmail.com': 0.31; 'import': 0.32; "i've": 0.33; 'url:listinfo': 0.33; 'bit': 0.33; 'correctly': 0.35; 'received:209.85': 0.37; 'url:python': 0.37; 'issue': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'url:org': 0.38; 'cc:2**1': 0.38; 'received:209': 0.39; 'how': 0.39; 'works': 0.40; "it's": 0.40; 'header:Received:5': 0.40; '2011': 0.62; 'mar': 0.64; 'march': 0.66; 'to:addr:googlegroups.com': 0.69; '30,': 0.80; '2.7.1': 0.84; 'hints?': 0.84; 'imap': 0.84; 'zhang': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=Uh330D2IgpZK0cu/3f5kh9gziBCScjvzmH2gq1dhpLU=; b=cAee1DaraZO6xn+512r+78x4v/rbcp6iYa/wMdIGBl+CYxMd4KUf10JC2jBJSdyB00 IWZvP02iCPM1VEnOLG9bbn1ptsxFhb5/ZViYBsJ4GO/1lb9NVTmMSBXL8J7NsgltxC6I WJoTgXeQb9je+8b0077l8KbswPRh7yvcxD5o8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=cUq9S5X3mmn/Icgyh37sH7QmgFIlpqdbHL9wDwS0gETgabNoO0HI/CkrdPss3UvFwA /Vz6WBPcaALwaYUk/uXJFjsMlG7jtVVLmUZ2OFfZfFMOWS+wXyCfysNmxWgFmR+DyzL6 qUp0EVtAnaO4NALEa2APMu6J2+lMXlgUBzeno= MIME-Version: 1.0 In-Reply-To: <17e12347-5f4f-4340-9436-a94cef63059e@glegroupsg2000goo.googlegroups.com> References: <17e12347-5f4f-4340-9436-a94cef63059e@glegroupsg2000goo.googlegroups.com> From: Yang Zhang Date: Thu, 31 Mar 2011 11:46:25 -0700 Subject: Re: multiprocessing Pool.imap broken? To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org, "eryksun \(\)" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 44 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1301597213 news.xs4all.nl 81475 [::ffff:82.94.164.166]:34125 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2295 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. =A0Any hints? =A0Than= ks >> 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. S= o 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 > --=20 Yang Zhang http://yz.mit.edu/