next up previous
Next: Locations and the at Up: Towards a Java Environment Previous: Distributed Arrays


The on Construct and the Active Process Group

The class Group (of which the process array classes are special cases) has a member function called local. This returns a boolean value which is true if the local process is a member of the group, false otherwise. In

  if(p.local()) {
    ...
  }
the code inside the conditional is executed only if the local process is a member p. We can say that inside this construct the active process group is restricted to p.

Our language provides a short way of writing this construct

  on(p) {
    ...
  }
The on construct provides some extra value. The language incorporates a formal idea of the active process group (APG). At any point of execution some process group is singled out as the APG. An on(p) construct specifically changes the value of the APG to p. On exit from the construct, the APG is restored to its value on entry.

Elevating the active process group to a part of the language allows some simplifications. For example, it provides a natural default for the on clause in array constructors. More importantly, formally defining the active process group simplifies the statement of various rules about what operations are legal inside distributed control constructs like on.


next up previous
Next: Locations and the at Up: Towards a Java Environment Previous: Distributed Arrays
Bryan Carpenter 2002-07-11