Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'api': 0.11; 'python': 0.11; 'creates': 0.14; 'finney': 0.16; 'processes.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:skip:m 10': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'module': 0.19; 'header :User-Agent:1': 0.23; 'closely': 0.24; 'looks': 0.24; 'header:X -Complaints-To:1': 0.27; "i'm": 0.30; 'follows': 0.31; 'terminate': 0.31; 'writes:': 0.31; 'url:python': 0.33; 'subject: (': 0.35; 'subject:with': 0.35; 'but': 0.35; 'module.': 0.36; 'done': 0.36; 'url:org': 0.36; 'so,': 0.37; 'ben': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'ability': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; '8bit%:29': 0.60; 'url:3': 0.61; 'address': 0.63; 'skip:\xe2 10': 0.65; 'close': 0.67; '8bit%:40': 0.68; 'brain,': 0.84; 'received:125': 0.84; 'edwards': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: python-daemon interaction with multiprocessing (secure-smtpd) Date: Thu, 08 May 2014 05:01:56 +1000 References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:+WLOdGlW74hvYz8TwguqJCcGApY= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399489328 news.xs4all.nl 2910 [2001:888:2000:d::a6]:55941 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71046 Grant Edwards writes: > On 2014-05-07, Grant Edwards wrote: > > How do you terminate a Python program that's using multiprocessing? > > It looks like you have to kill all the threads individually. :/ As I understand it, the ‘multiprocessing’ module does not create multiple threads; it creates multiple processes. It also closely follows the API for the ‘threading’ module. That includes the ability to manage a pool of workers . You can ask the pool of workers to close when they're done . Does that address the requirement? -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but if we give peas a chance, won't the lima beans feel | _o__) left out?” —_Pinky and The Brain_ | Ben Finney