global interpreter lock

Paul Rubin http
Sat Aug 20 22:39:56 EDT 2005


Mike Meyer <mwm at mired.org> writes:
> Even simpler to program in is the model used by Erlang. It's more CSP
> than threading, though, as it doesn't have shared memory as part of
> the model. But if you can use the simpler model to solve your problem
> - you probably should.

Well, ok, the Python equivalent would be wrapping every shareable
object in its own thread, that communicates with other threads through
Queues.  This is how some Pythonistas suggest writing practically all
multi-threaded Python code.  It does a reasonable job of avoiding
synchronization headaches and it's not that hard to code that way.

But I think to do it on Erlang's scale, Python needs user-level
microthreads and not just OS threads.  Maybe Python 3000 can add some
language support, though an opportunity was missed when Python's
generator syntax got defined the way it did.

I've been reading a bit about Erlang and am impressed with it.  Here
is a good thesis about parallelizing Erlang, link courtesy of Ulf
Wiger on comp.lang.functional:

  http://www.erlang.se/publications/xjobb/0089-hedqvist.pdf

The thesis also gives a good general description of how Erlang works.



More information about the Python-list mailing list