[pypy-svn] r33312 - pypy/dist/pypy/doc/discussion

fijal at codespeak.net fijal at codespeak.net
Sun Oct 15 13:09:05 CEST 2006


Author: fijal
Date: Sun Oct 15 13:08:50 2006
New Revision: 33312

Added:
   pypy/dist/pypy/doc/discussion/distribution-implementation.txt   (contents, props changed)
Log:
Added implementation notes, very preliminary.


Added: pypy/dist/pypy/doc/discussion/distribution-implementation.txt
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/doc/discussion/distribution-implementation.txt	Sun Oct 15 13:08:50 2006
@@ -0,0 +1,51 @@
+=====================================================
+Random implementation details of distribution attempt
+=====================================================
+
+.. contents::
+.. sectnum::
+
+This document attempts to broaden this `dist thoughts`_.
+
+.. _`dist thoughts`: distribution-newattempt.html
+
+Basic implementation:
+---------------------
+
+First we do split objects into value-only primitives (like int) and other.
+Basically immutable builtin types which cannot contain user-level objects
+(int, float, long, str, None, etc.) will be always transfered as value-only
+objects (having no states etc.). The every other object (user created classes,
+instances, modules, lists, tuples, etc. etc.) are always executed by reference.
+(Of course if somebody wants to ie. copy the instance, he can marshal/pickle
+this to string and send, but it's outside the scope of this attempt). Special
+case might be immutable data structure (tuple, frozenset) containing simple
+types (this becomes simple type).
+
+XXX: What to do with code types? Marshalling them and sending seems to have no
+sense. Remote execution? Local execution with remote f_locals and f_globals?
+
+Every remote object has got special class W_RemoteXXX where XXX is interp-level
+class implementing this object. W_RemoteXXX implements all the operations
+by using special app-level code that sends method name and arguments over the wire
+(arguments might be either simple objects which are simply send over the app-level
+code or references to local objects).
+
+So the basic scheme would look like::
+
+remote_ref = remote("Object reference")
+remote_ref.any_method()
+
+``remote_ref`` in above example looks like normal python object to user,
+but is implemented differently (W_RemoteXXX), and uses app-level proxy
+to forward each interp-level method call.
+
+App-level remote tool:
+----------------------
+
+For purpose of app-level tool which can transfer the data (well, socket might
+be enough, but suppose I want to be more flexible), I would use `py.execnet`_,
+probably using some of the Armin's hacks to rewrite it using greenlets instead
+of threads.
+
+.. _`py.execnet`: http://codespeak.net/py/current/doc/execnet.html
\ No newline at end of file



More information about the Pypy-commit mailing list