[pypy-dev] Why is there a separate ExecutionContext?

Rocco Moretti roccomoretti at netscape.net
Thu Mar 6 03:19:22 CET 2003

"logistix" <vze55z8s at verizon.net> wrote:

>Would it be semantically clearer if PyFrames got an executioncontext
>object in the constructor instead of the space object?  Space could
>still be accessed via frame.ec.space.  Frame.space.getexecutioncontext()
>seems like you're running in circles. 

Actually, in the interest of generality, I'd argue that ExecutionContexts 
should not contain a link to the object space - it should be a per frame 
value. If you think of a future time when multiple ObjSpaces coexist in 
the same interpreter, a frame in one ObjSpace will be able to call a frame 
in another ObjSpace. Since a function in one ObjSpace can call a function 
in a different ObjSpace, the ObjSpace for the ExecutionContext is not 

The trick in calling across ObjSpaces is marshaling/demarshaling 
arguments/return values. For now we can deal with it by requiring function 
calls either to be in the same ObjSpace, or by .wrap()ing and then .unwrap
()ing the values. A more general mechanism can be worked out when we have 
more than one non-trivial object space.


The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

More information about the Pypy-dev mailing list