Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!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.038 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'base.': 0.05; 'interpreted': 0.09; 'cc:addr:python-list': 0.11; 'bug': 0.12; 'benjamin': 0.16; 'processes.': 0.16; 'right;': 0.16; 'subject: \n ': 0.16; 'subject:exception': 0.16; 'subject:program': 0.16; 'subject:skip:m 10': 0.16; 'top-level': 0.16; 'wing': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'result.': 0.19; '>>>': 0.22; 'saying': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'class.': 0.26; 'header:In- Reply-To:1': 0.27; "i'm": 0.30; '(unless': 0.31; 'ray': 0.31; 'subject:the': 0.34; 'no,': 0.35; 'interact': 0.36; 'scheduled': 0.36; 'should': 0.36; 'wrong': 0.37; 'clear': 0.37; 'pm,': 0.38; 'rather': 0.38; 'dave': 0.60; 'most': 0.60; "you're": 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'received:74.208': 0.68; 'further,': 0.74; 'william': 0.81; 'completes': 0.84; 'oscar': 0.84; 'received:74.208.4.194': 0.84; 'subject:source': 0.84; 'angel': 0.91; '2013': 0.98 Date: Wed, 24 Apr 2013 20:11:51 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Oscar Benjamin Subject: Re: Finding the source of an exception in a python multiprocessing program References: <5BC4D9D9-D757-40F3-81CA-CF4FA5C73A96@mac.com> <51786A2C.4020306@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:dErr4WG4D94azFbtEn6qisT4G44YOLYrAI09VfLiaMn 2JKofTm44VlioI9OfPuIKJqUIjOurHPNWaI7YKCqtX/NqHs7uF vrkWvKGziQ7G5zRCn9VYQJZopyk6SkJQPKi+vzlD2YxI3icHEH vGvPfoAKxLNDaPNyfQpgGfMQOfDTkfvlMopYJNuEXfkqw4XeD/ 6+nOiD+tHhbdipP+14aRVo+E6cCghth+aA1g4YFLD8viILwhQ6 WtdRzDtFV9GXY4O7dA0vC305KevJQegNyYhs8VZ13yoPNwUnuh NlL2HKqsbfyP+gTQAOpO71mLc4FIo9FHk8EXnkqK/51mk8dhQ= = Cc: python-list@python.org 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366848732 news.xs4all.nl 15893 [2001:888:2000:d::a6]:45872 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44305 On 04/24/2013 08:00 PM, Oscar Benjamin wrote: > On 25 April 2013 00:26, Dave Angel wrote: >> On 04/24/2013 05:09 PM, William Ray Wing wrote: >>> >>> >>> >>> >> >> My question is why bother with multithreading? Why not just do these as >> separate processes? You said "they in no way interact with each other" and >> that's a clear clue that separate processes would be cleaner. > > It's using multiprocessing rather than threads: they are separate processes. > You're right; I was completely off base. brain-freeze. >> >> > > It's state that is passed to it by the subprocess and should only be > accessed by the top-level process after the subprocess completes (I > think!). > >> >> Separate processes will find it much more difficult to interact, which is a >> good thing most of the time. Further, they seem to be scheduled more >> efficiently because of the GIL, though that may not make that much >> difference when you're time-limited by network data. > > They are separate processes and do not share the GIL (unless I'm very > much mistaken). No, you're not mistaken. Somehow I interpreted the original as saying multi-thread, and everything else was wrong as a result. Now it sounds like a bug in, or misuse of, the Pool class. -- DaveA