I just killed GIL!!!

Rhamphoryncus rhamph at gmail.com
Fri Apr 18 18:29:11 CEST 2008


On Apr 18, 4:30 am, Nick Craig-Wood <n... at craig-wood.com> wrote:
> Rhamphoryncus <rha... at gmail.com> wrote:
> >  On Apr 17, 7:40 am, Steve Holden <st... at holdenweb.com> wrote:
> > > I'd love to be wrong about that, but the GIL *has* been the subject of
> > > extensive efforts to kill it over the last five years, and it has
> > > survived despite the best efforts of the developers.
>
> >  Yo.  http://code.google.com/p/python-safethread/
>
> Sounds very interesting.  I particularly liked this bit from the web
> page - an excellent solution to fine grained locking.  Sending only
> immutable objects between threads is very like the functional approach
> used by Erlang which is extremely good at concurrency.

Although superficially similar, the details of Erlang are actually
pretty different.  It copies all objects passed between threads - it
was originally designed for fault tolerance (entire nodes going down),
not concurrency.  If you want a shared mutable object you need to use
a "process" as one, treating it as an actor.  Hopefully you can do
most of it in a one-way, message driven style, as otherwise you're
going to be transforming your synchronous calls into a series of
callbacks.

If you have a node farm, you want to upgrade it incrementally, and you
want it to be fault tolerant (nodes go down at random without kill the
whole thing), Erlang is much better than safethread.  That's at a
significant cost though, as it's only good at the one style.
Safethread is much better at a style useful on a single desktop.



More information about the Python-list mailing list