Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'cpython': 0.05; 'python': 0.11; "(i'm": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'numpy': 0.16; 'objects.': 0.16; 'operation,': 0.16; 'subject:recursion': 0.16; 'this)': 0.16; 'threads,': 0.16; 'wrote:': 0.18; 'certainly': 0.24; 'subject:problem': 0.24; 'mon,': 0.24; 'regardless': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'running': 0.33; 'subject:the': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'depends': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'release': 0.40; 'ian': 0.60; 'most': 0.60; 'include:': 0.61; 'yes': 0.68; '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:date:message-id:subject:from:to :content-type; bh=SV/0/WxbkFq63HSdfrbGRZhe3HKgN6wTgGy4jhIhWnw=; b=GmRWBaoIzgv2csu601+kAjba2zEft4qTZJdplPng5ezshQJJ5Gt+eJaSYB0FyXxVgW Nv/T/D786z0bNb5XbfivUE4hXypmw8Xeik55aNQpCsXRKM83DwfC4nRFALrwG3ncBkn9 /3fZZ2dfOJQ8+mT6oMpocQdat0H/NALq6PAOHV+rZgGRhmIRGn0DMR2be7jz0uS5KQfe eUcUWXcDecb3rcDdr1XDcU51ctsjXRSuzxCo9cwr0GzkyWooBdgtykHqFsgV88Qfh4np PzTtE3UvTWNWz2diagbUnjLjvI4C5NtMfcFDYqBDbLEi93cAmSoSTm3UxXc2ARP+Hs3i lpjA== MIME-Version: 1.0 X-Received: by 10.220.111.133 with SMTP id s5mr3043195vcp.63.1369606594109; Sun, 26 May 2013 15:16:34 -0700 (PDT) In-Reply-To: References: <55942e65-e4a5-45fc-b2fc-ceb4020959dd@k4g2000vba.googlegroups.com> <074eac8a-1bc4-4fe0-afa9-1f52405f81d5@k3g2000vbn.googlegroups.com> Date: Mon, 27 May 2013 08:16:34 +1000 Subject: Re: Solving the problem of mutual recursion From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369606596 news.xs4all.nl 15897 [2001:888:2000:d::a6]:50122 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46130 On Mon, May 27, 2013 at 5:35 AM, Ian Kelly wrote: > I'm pretty sure that CPython uses the GIL regardless of platform. And > yes you can have multiple OS-level threads, but because of the GIL > only one will actually be running at a time. Other possibilities > include: 6) It's spinning in a function that has released the GIL. Python threads can certainly execute concurrently; they just can't be manipulating Python objects. Most of the I/O functions will release the GIL before doing a potentially-blocking operation, and some CPU-heavy functions can do the same (I'm given to understand that numpy does this) - just depends on having a long job that involves no refcounted objects. ChrisA