Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'space.': 0.07; 'python': 0.08; 'tends': 0.09; 'am,': 0.12; '16,': 0.15; 'cc:addr:python- list': 0.15; 'containers': 0.16; 'cores': 0.16; 'heavier': 0.16; 'os.': 0.16; 'received:192.168.1.104': 0.16; 'scheduled.': 0.16; 'subject:threads': 0.16; 'sucks': 0.16; 'switching': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'seems': 0.19; 'trying': 0.21; 'cc:no real name:2**0': 0.21; 'maybe': 0.21; 'asked': 0.22; "doesn't": 0.23; 'weight': 0.23; "shouldn't": 0.23; 'header:In-Reply-To:1': 0.23; 'separate': 0.28; 'cc:addr:python.org': 0.29; 'problem': 0.29; 'cc:addr:gmail.com': 0.30; 'generally': 0.30; 'false.': 0.30; 'processes.': 0.30; 'threads': 0.30; 'least': 0.31; 'nov': 0.31; 'pm,': 0.31; 'michael': 0.31; 'cases': 0.32; 'comment': 0.32; 'operating': 0.33; 'header:User-Agent:1': 0.33; 'scheduling': 0.34; 'things': 0.35; 'external': 0.35; 'response': 0.35; 'core': 0.36; 'cc:2**1': 0.36; 'thread': 0.36; 'but': 0.37; 'run': 0.38; 'some': 0.38; 'starting': 0.38; 'received:192': 0.38; 'basic': 0.39; 'subject:: ': 0.39; 'change': 0.39; 'really': 0.40; 'within': 0.60; 'managing': 0.60; 'address': 0.61; '2011': 0.62; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.71; 'hunter': 0.84; 'overhead.': 0.84 Date: Wed, 16 Nov 2011 13:06:40 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: Michael Hunter Subject: Re: Multiple threads References: <31766634.4.1321451296410.JavaMail.geo-discussion-forums@yqcm23> <4EC3F298.1030604@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:TSUDPdnOg6BZD3dUcp5qydLVfVvEdo0UrBQtFIiyey0 DvPqhaHr0m02ucLYgIR6CjieGUfquxH3jmI4OfUxJp+LrtwBTL eqtSyln/foZwsSgNDQc59sv9pMBB68yy/ma82Z/khld1A/62w4 g340omoIAiK7nu5LBHQlfUL5I5YLMdXvI5TrKGO48qqvs8FTu5 RBDIOs6RHSHPCG4oGa87LrIct4rMVSuTRts3gwGoPuA3/5d2rj z1GlsbNvERaezwLQ8qHFw91Ht2pR8pcLIP/Cj+2eFHBRM756y9 6slEiLt0xtGNGf1rkTtX4s1l/9wSBjCNY4Z7l4ughBdjUWQZw= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321466964 news.xs4all.nl 6959 [2001:888:2000:d::a6]:39860 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15783 On 11/16/2011 12:55 PM, Michael Hunter wrote: > On Wed, Nov 16, 2011 at 9:27 AM, Dave Angel wrote: >> On 11/16/2011 12:00 PM, Jack Keegan wrote: >> [...] Processes [...] and the OS is generally better at scheduling them than it is at >> scheduling threads within a single process. If you have multiple cores, the >> processes can really run simultaneously, frequently with very small >> overhead. [...] > > Maybe you are trying to simplify things but in a lot of cases this is > just false. In at least some operating systems these days a thread is > the basic unit that is scheduled. Processes are thread containers > that provide other things (fds, separate address space, etc.). The > comment about multiple cores can be extended to multiple threads on a > core (CMT) but applies to threads as well as processes. Switching > between processes tends to be heavier weight then switching between > threads in a process because of the needs to change the address space. > > Just because Python sucks at threads doesn't make them heavier for the OS. > > That doesn't mean you shouldn't use multiprocessing. The problem > asked about seems a good fit to me to a single python process starting > and managing a set of external converter processes. > > Michael > No response is deserved. -- DaveA