[pypy-dev] multithread support review?

Christian Tismer tismer at tismer.com
Mon Jan 13 02:22:39 CET 2003

Rodrigo B. de Oliveira wrote:
> Are you considering reviewing the current state of multi thread support
> in python? I mean something like removing the need for the GIT :-)

The GIL?

Well, speaking for myself, I never liked the necessity
to have a GIL, nor did I like the idea of building
free threading into everything.
Personally, I would prefer not to support threads in that
sense at all, but only microthreads/tasklets from the
Stackless package, which is much cheaper to implement.

In my model, real threads in that sense would not have
locking problems in the first place, but they would much
more look like disjoint processes. I would not let run
multiple threads in one interpreter, but give every thread
an extra interpreter, and have all threads strictly
Communication would then be an extra action, which has
to be done explicitly, by passign read-only references
or explicit copies for writing. That would remove the
load to always lock threads against each other, or to make
all vulnerable objects thread-safe.
Well, that's how I had done it, probably.

Without re-designing Python (which is one of our goals,
avoid language changes), we have no chance. Either threads
have to be left out for now, or we need the GIL, too.
I don't think it should be a primary goal of MiniPy to
solve the Python thread problem in the first place.
I believe, after having a running MiniPy, it can be used
to exercise different threading models, and this much
easier than with the current C based version.

I don't believe that Python's current thread model is
the final word spoken. I would like to change it or
to provide alternatives.
This is a reason to have something like MiniPy, but
not part of it.

ciao - chris

Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

More information about the Pypy-dev mailing list