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


Groups > comp.lang.python > #15783

Re: Multiple threads

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 <d@davea.name>
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 <d@davea.name>
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 <tahoemph@gmail.com>
Subject Re: Multiple threads
References <31766634.4.1321451296410.JavaMail.geo-discussion-forums@yqcm23> <CAPTjJmoAWni4-wyKB4HgAJ5KvTbz42_BC3f22MOnugUmmXzVtA@mail.gmail.com> <CAAdqOWF=irJXFO2q2+o8jpM09GMLf8N+NTNGTOtMhwKgtG6jag@mail.gmail.com> <4EC3F298.1030604@davea.name> <CAGHENPSX25MH-GoXOERV19iXd8em=W+_owmSJi6V5GsmeV=1sg@mail.gmail.com>
In-Reply-To <CAGHENPSX25MH-GoXOERV19iXd8em=W+_owmSJi6V5GsmeV=1sg@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2777.1321466964.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


On 11/16/2011 12:55 PM, Michael Hunter wrote:
> On Wed, Nov 16, 2011 at 9:27 AM, Dave Angel<d@davea.name>  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

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


Thread

Multiple threads Eduardo Oliva <dutche@gmail.com> - 2011-11-16 05:48 -0800
  Re: Multiple threads Chris Angelico <rosuav@gmail.com> - 2011-11-17 00:55 +1100
  Re: Multiple threads Henrik Faber <hfaber@invalid.net> - 2011-11-16 15:07 +0100
  Re: Multiple threads Christian Heimes <lists@cheimes.de> - 2011-11-16 16:01 +0100
  Re: Multiple threads Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-11-16 17:45 +0100
    Re: Multiple threads Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-11-16 16:38 -0800
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 12:27 -0500
  Re: Multiple threads Michael Hunter <tahoemph@gmail.com> - 2011-11-16 09:55 -0800
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 13:06 -0500
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 13:30 -0500
  Re: Multiple threads Miki Tebeka <miki.tebeka@gmail.com> - 2011-11-16 12:50 -0800

csiph-web