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


Groups > comp.lang.python > #7164 > unrolled thread

Re: GIL in alternative implementations

Started byCarl Banks <pavlovevidence@gmail.com>
First post2011-06-07 10:08 -0700
Last post2011-06-07 10:08 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Re: GIL in alternative implementations Carl Banks <pavlovevidence@gmail.com> - 2011-06-07 10:08 -0700

#7164 — Re: GIL in alternative implementations

FromCarl Banks <pavlovevidence@gmail.com>
Date2011-06-07 10:08 -0700
SubjectRe: GIL in alternative implementations
Message-ID<mailman.2535.1307466529.9059.python-list@python.org>
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.


Carl Banks

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web