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


Groups > comp.lang.python > #55455

Re: Multiple scripts versus single multi-threaded script

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'startup': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'run,': 0.09; 'subject:script': 0.09; 'windows,': 0.09; 'thread': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'subject:versus': 0.16; 'threads,': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'task': 0.26; 'header:X -Complaints-To:1': 0.27; 'run': 0.32; 'linux': 0.33; 'becomes': 0.33; 'but': 0.35; 'similar': 0.36; 'starting': 0.37; 'e.g.': 0.38; 'tasks': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'new': 0.61; 'smith': 0.68; 'received:130': 0.73; 'lack': 0.78; 'computation,': 0.84; 'from:addr:jeremy': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Jeremy Sanders <jeremy@jeremysanders.net>
Subject Re: Multiple scripts versus single multi-threaded script
Date Fri, 04 Oct 2013 10:02:42 +0200
References <f01b2e7a-9fc7-4138-bb6e-447d31179f2d@googlegroups.com> <roy-451497.12415103102013@news.panix.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host lap75107.mpe.mpg.de
User-Agent KNode/4.10.5
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.710.1380873727.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1380873727 news.xs4all.nl 15865 [2001:888:2000:d::a6]:50431
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:55455

Show key headers only | View raw


Roy Smith wrote:

> Threads are lighter-weight.  That means it's faster to start a new
> thread (compared to starting a new process), and a thread consumes fewer
> system resources than a process.  If you have lots of short-lived tasks
> to run, this can be significant.  If each task will run for a long time
> and do a lot of computation, the cost of startup becomes less of an
> issue because it's amortized over the longer run time.

This might be true on Windows, but I think on Linux process overheads are 
pretty similar to threads, e.g.
http://stackoverflow.com/questions/807506/threads-vs-processes-in-linux

Combined with the lack of a GIL-conflict, processes can be pretty efficient.

Jeremy

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


Thread

Multiple scripts versus single multi-threaded script JL <lightaiyee@gmail.com> - 2013-10-03 09:01 -0700
  Re: Multiple scripts versus single multi-threaded script Roy Smith <roy@panix.com> - 2013-10-03 12:41 -0400
    Re: Multiple scripts versus single multi-threaded script Chris Angelico <rosuav@gmail.com> - 2013-10-04 02:50 +1000
      Re: Multiple scripts versus single multi-threaded script Roy Smith <roy@panix.com> - 2013-10-03 14:28 -0400
        Re: Multiple scripts versus single multi-threaded script Chris Angelico <rosuav@gmail.com> - 2013-10-04 04:36 +1000
          Re: Multiple scripts versus single multi-threaded script Roy Smith <roy@panix.com> - 2013-10-03 15:53 -0400
            Re: Multiple scripts versus single multi-threaded script Chris Angelico <rosuav@gmail.com> - 2013-10-04 08:22 +1000
    Re: Multiple scripts versus single multi-threaded script Dave Angel <davea@davea.name> - 2013-10-03 18:40 +0000
    Re: Multiple scripts versus single multi-threaded script Jeremy Sanders <jeremy@jeremysanders.net> - 2013-10-04 10:02 +0200
    Re: Multiple scripts versus single multi-threaded script Grant Edwards <invalid@invalid.invalid> - 2013-10-04 16:38 +0000
  Re: Multiple scripts versus single multi-threaded script Chris Angelico <rosuav@gmail.com> - 2013-10-04 02:42 +1000

csiph-web