Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'anyway).': 0.07; 'x-mailer:evolution 2.28.3': 0.07; 'python': 0.07; 'blocking': 0.14; 'wrote:': 0.14; '(assuming': 0.16; 'cores': 0.16; 'subject:GIL': 0.16; 'threading': 0.16; '(i.e.': 0.18; 'subject:Questions': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'seems': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'gil': 0.23; 'chris': 0.27; 'google': 0.27; 'fri,': 0.29; 'indicated': 0.29; "won't": 0.30; 'cc:addr:python.org': 0.31; 'lock': 0.31; "isn't": 0.34; 'instances': 0.35; 'running': 0.36; 'way.': 0.37; 'issue': 0.37; 'run': 0.37; 'designing': 0.38; 'parallel': 0.38; 'subject:web': 0.38; 'not,': 0.39; 'tim': 0.39; 'header:Mime-Version:1': 0.39; 'how': 0.39; 'factor': 0.60; 'subject:about': 0.66; 'due': 0.67; 'articles': 0.67; 'reply-to:no real name:2**0': 0.72; 'header :Reply-To:1': 0.72; 'received:bethere.co.uk': 0.84; 'service)': 0.84; 'subject:services': 0.93 Subject: Re: Questions about GIL and web services from a n00b From: Tim Wintle To: Chris H In-Reply-To: <4DA8734C.1080706@WindsorCircle.com> References: <4DA8734C.1080706@WindsorCircle.com> Content-Type: text/plain; charset="UTF-8" Organization: Team Rubber Date: Fri, 15 Apr 2011 18:03:32 +0100 Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 87.194.110.230 X-SA-Exim-Mail-From: tim.wintle@teamrubber.com X-SA-Exim-Scanned: No (on mail.netsight.co.uk); SAEximRunCond expanded to false Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: tim.wintle@teamrubber.com 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: 21 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302887972 news.xs4all.nl 81482 [::ffff:82.94.164.166]:41629 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3277 On Fri, 2011-04-15 at 12:33 -0400, Chris H wrote: > > 1. Are you sure you want to use python because threading is not good > due to the Global Lock (GIL)? Is this really an issue for > multi-threaded web services as seems to be indicated by the articles > from a Google search? If not, how do you avoid this issue in a > multi-threaded process to take advantage of all the CPU cores > available? Is the limiting factor CPU? If it isn't (i.e. you're blocking on IO to/from a web service) then the GIL won't get in your way. If it is, then run as many parallel *processes* as you have cores/CPUs (assuming you're designing an application that can have multiple instances running in parallel so that you can run over multiple servers anyway). Tim Wintle