Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7176

Re: GIL in alternative implementations

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 <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'next,': 0.05; 'chunk': 0.07; 'though.': 0.07; 'python': 0.08; '"hello': 0.09; '>>>>': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'function:': 0.09; 'message- id:@stoneleaf.us': 0.09; 'prevents': 0.09; 'received:gator410.hostgator.com': 0.09; 'that).': 0.09; '~ethan~': 0.09; '>>>': 0.12; 'def': 0.12; 'wrote:': 0.14; 'concurrency,': 0.16; 'f(a,': 0.16; 'iteration.': 0.16; 'lookup': 0.16; 'patching': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'subject:GIL': 0.16; 'subject:alternative': 0.16; 'this?': 0.19; 'header:In-Reply-To:1': 0.21; 'code': 0.24; 'function': 0.25; 'example': 0.27; "i'm": 0.27; 'sat,': 0.29; 'carl': 0.30; 'lot.': 0.30; 'changes': 0.30; 'patch': 0.32; 'steven': 0.32; 'to:addr :python-list': 0.33; '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; 'useful': 0.37; 'change': 0.37; 'affects': 0.37; 'two': 0.37; 'think': 0.38; 'but': 0.38; 'monday,': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'allows': 0.40; 'meaning': 0.40; 'john': 0.62; 'received:websitewelcome.com': 0.67; 'june': 0.77; 'received:69.56': 0.77; '-0300,': 0.84; 'genellina': 0.84; 'received:gateway16.websitewelcome.com': 0.84; 'gabriel': 0.91
Date Tue, 07 Jun 2011 10:51:00 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version 1.0
To python-list@python.org
Subject Re: GIL in alternative implementations
References <7d244fb0-5457-4070-8569-306797f70131@glegroupsg2000goo.googlegroups.com>
In-Reply-To <7d244fb0-5457-4070-8569-306797f70131@glegroupsg2000goo.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator410.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:2250
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 2
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ==
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2540.1307475231.9059.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 82.94.164.166
X-Trace 1307475231 news.xs4all.nl 49039 [::ffff:82.94.164.166]:36297
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7176

Show key headers only | View raw


Carl Banks wrote:
> 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  
>> <steve+comp....@pearwood.info> escribi�:
>>
>>> 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 = a + b
>>>     d = c*3
>>>     return "hello world"*d
>>>
>>>
>>> how would I patch this function while it is executing?
>> I think John Nagle was thinking about rebinding names:
>>
>>
>> def f(self, a, b):
>>    while b>0:
>>      b = g(b)
>>      c = a + b
>>      d = self.h(c*3)
>>    return "hello world"*d
>>
>> both g and self.h may change its meaning from one iteration to the next,  
>> so a complete name lookup is required at each iteration. This is very  
>> 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 that can do that).
> 
> I'm not sure where he gets the idea that this has any impact on concurrency, though.

What if f has two calls to self.h() [or some other function], and self.h 
changes in between?

Surely that would be a major headache.

~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: GIL in alternative implementations Carl Banks <pavlovevidence@gmail.com> - 2011-06-07 10:08 -0700
  Re: GIL in alternative implementations Ethan Furman <ethan@stoneleaf.us> - 2011-06-07 10:51 -0700
  Re: GIL in alternative implementations Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-07 14:22 -0600
  Re: GIL in alternative implementations Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-07 14:23 -0600

csiph-web