Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'everyone!': 0.07; 'subject:Questions': 0.07; 'url:pypy': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'thread': 0.14; 'subject:GIL': 0.16; 'wrote:': 0.18; 'hey': 0.18; 'code,': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'source': 0.25; 'first,': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'received:209.85.217': 0.29; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; 'subject:About': 0.31; 'run': 0.32; 'core': 0.34; 'could': 0.34; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'to:addr:gmail.com': 0.65; 'faster.': 0.84; 'points,': 0.84; 'quicker': 0.84; 'touched': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5/Xc25MUlyecjCNasP2UTTB64l+7dxGKCizxkRyUKPw=; b=sJ9Y6MXHHGBvlOukzCYH/mi2BccbNLZ6qswBvPcTd8v93m7hEDun5t9H+mYJQh6bZJ dnuYdoQbq4Jv/snjfywPKDNjDieFZ1OHOb2+Ufxc6awHe594KqXJb8VY/czLucZCRd7e W2wanCfqGocxA+8IjyztIEPo2SwW1A9Vd8bOnPrl2biuLrKNQLrKHYj3gea8CvdF7z2K CG4atjtn3eEIE0d7zkpqIXv3tnFgyzkQN9cnZFoYrTGDrS/ZjdgPOxt3rjFeYGdVJLM6 wJaU8XZRetdD6jbYay8zqWYSaAq/8tOYk/ry05g+SYI8cqbfie4ud1PlLaYpq26JBpt0 qhpw== X-Received: by 10.112.42.44 with SMTP id k12mr1736051lbl.63.1371736595385; Thu, 20 Jun 2013 06:56:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Joshua Landau Date: Thu, 20 Jun 2013 14:55:55 +0100 Subject: Re: About GIL Questions! To: Thanatos xiao Content-Type: text/plain; charset=UTF-8 Cc: python-list 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371736603 news.xs4all.nl 15905 [2001:888:2000:d::a6]:49569 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48793 On 20 June 2013 05:13, Thanatos xiao wrote: > Hey everyone! > Recently I see the python source code, but i still not understand about gil. > first, why single core quicker multi-core ? Chris Angelico touched on your other points, but not this as clearly; Python threads run on one thread because they have to. It is not because they're faster. Python theoretically would be faster if its threads could run multicore, but it's really hard to make that work. See http://pypy.org/tmdonate.html for an example of the acrobatics it would take to get a propper GIL-free Python.