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: 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 Subject: Re: Multiple scripts versus single multi-threaded script Date: Fri, 04 Oct 2013 10:02:42 +0200 References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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