Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'next,': 0.05; 'chunk': 0.07; 'though.': 0.07; 'python': 0.08; '"hello': 0.09; 'function:': 0.09; 'prevents': 0.09; 'that).': 0.09; 'def': 0.12; 'wrote:': 0.14; 'concurrency,': 0.16; 'f(a,': 0.16; 'iteration.': 0.16; 'lookup': 0.16; 'message- id:@glegroupsg2000goo.googlegroups.com': 0.16; 'patching': 0.16; 'reply-to:addr:comp.lang.python': 0.16; 'subject:GIL': 0.16; 'subject:alternative': 0.16; 'to:addr:comp.lang.python': 0.16; 'cc:addr:python-list': 0.17; 'this?': 0.19; 'header:In-Reply- To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'code': 0.24; 'function': 0.25; 'example': 0.27; "i'm": 0.27; 'sat,': 0.29; 'cc:addr:python.org': 0.30; 'carl': 0.30; 'lot.': 0.30; 'patch': 0.32; 'steven': 0.32; 'received:209.85.212': 0.34; 'thinking': 0.34; 'header:User-Agent:1': 0.35; '-0700,': 0.35; "d'aprano": 0.35; 'sometimes,': 0.35; 'languages': 0.35; 'idea': 0.36; 'received:google.com': 0.37; 'useful': 0.37; 'change': 0.37; 'received:209.85': 0.37; 'affects': 0.37; 'think': 0.38; 'but': 0.38; 'monday,': 0.38; 'subject:: ': 0.38; 'received:209': 0.39; 'allows': 0.40; 'meaning': 0.40; 'john': 0.62; 'to:addr:googlegroups.com': 0.63; 'header:Reply-To:1': 0.72; 'reply-to:no real name:2**0': 0.72; 'reply- to:addr:googlegroups.com': 0.73; 'june': 0.77; '-0300,': 0.84; 'genellina': 0.84; 'gabriel': 0.91; 'received:209.85.212.56': 0.91; 'received:mail-vw0-f56.google.com': 0.91 Newsgroups: comp.lang.python Date: Tue, 7 Jun 2011 10:08:47 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=157.127.155.214; posting-account=XFEWnwoAAADNO10m3Wcmq_SWdmyZuXff User-Agent: G2/1.0 X-Google-Web-Client: true MIME-Version: 1.0 Subject: Re: GIL in alternative implementations From: Carl Banks To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: comp.lang.python@googlegroups.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 45 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307466530 news.xs4all.nl 49181 [::ffff:82.94.164.166]:54583 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7164 On Monday, June 6, 2011 9:03:55 PM UTC-7, Gabriel Genellina wrote: > En Sat, 28 May 2011 14:05:16 -0300, Steven D'Aprano =20 > escribi=EF=BF=BD: >=20 > > On Sat, 28 May 2011 09:39:08 -0700, John Nagle wrote: > > > >> Python allows patching code while the code is executing. > > > > Can you give an example of what you mean by this? > > > > If I have a function: > > > > > > def f(a, b): > > c =3D a + b > > d =3D c*3 > > return "hello world"*d > > > > > > how would I patch this function while it is executing? >=20 > I think John Nagle was thinking about rebinding names: >=20 >=20 > def f(self, a, b): > while b>0: > b =3D g(b) > c =3D a + b > d =3D self.h(c*3) > return "hello world"*d >=20 > both g and self.h may change its meaning from one iteration to the next, = =20 > so a complete name lookup is required at each iteration. This is very =20 > useful sometimes, but affects performance a lot. It's main affect performance is that it prevents an optimizer from inlining= a function call(which is a good chunk of the payoff you get in languages t= hat can do that). I'm not sure where he gets the idea that this has any impact on concurrency= , though. Carl Banks