Call by Sharing



next up previous contents index
Next: Run-Time Dispatch Up: Invocation Previous: Form of Invocation

Call by Sharing

The caller and called routine communicate only through the argument and result objects; routines do not have access to any variables of the caller.

After the assignments of actual arguments to formal arguments, the caller and the called routine share objects. If the called routine modifies a shared object, the modification is visible to the caller on return. The names used to denote the shared objects are distinct in the caller and called routine; if a routine assigns an object to a formal argument variable, there is no effect on the caller. From the point of view of the invoked routine, the only difference between its formal argument variables and its other local variables is that the formals are initialized by its caller.



theta-questions@lcs.mit.edu