[pypy-dev] Very confused? -can someone at least tell me..? (was naive vm question)

Armin Rigo arigo at tunes.org
Thu Nov 22 05:31:58 CET 2007


Hi Peter,

On Mon, Nov 19, 2007 at 04:29:00AM +1300, Peter Fraser wrote:
> 1. Suppose you ran the PyPy-C interpreter as a CPython extension. Could 
> the extension release the CPython GIL?

Yes.  The part of your argument which seems confusing, though, is that
you don't really need to have one CPython and one PyPy in order to run
Python code on two CPUs in parallel.  You don't gain much (except
confusion) by running one CPython and one PyPy for this purpose.  (There
are other reasons why you might want to do that, like using some special
PyPy feature in a subpart of your CPython application.)

In fact, the only restriction is that putting two CPythons in the same
process is not really possible.  Aside from that, you could do any of
the following:

* run several CPythons in two different processes and communicate using
  pipes, or shared memory, etc.

* run several PyPys in either the same or different processes

An advantage of PyPy over CPython in this domain is that because
multiple PyPys can run in the same process you could experiment with
communication models based on in-process shared data and locks.


A bientot,

Armin



More information about the Pypy-dev mailing list